<style>
.layout {
  background: #f5f7f9;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

.red-star {
  font-family: SimSun;
  color: #f00;
  margin-right: 4px;
}

.demo-spin-icon-load {
  animation: ani-demo-spin 1s linear infinite;
}

.demo-spin-col {
  height: 100px;
  position: relative;
}

.mb20 {
  margin-bottom: 20px;
}

/*.mb2 {*/
/*  margin-bottom: 2px;*/
/*}*/

.layout-logo {
  width: 110px;
  height: 30px;
  background: #5b6270;
  border-radius: 3px;
  float: left;
  position: relative;
  top: 15px;
  left: 20px;
}

.layout-nav {
  width: 420px;
  margin: 0 auto;
  margin-right: 20px;
}

.layout-footer-center {
  text-align: center;
}

.content {
  height: auto;
  background-color: white;
  padding-left: 30px;
  padding-right: 30px;
}

.items {
  height: 40px;
  line-height: 40px
}

.info {
  height: auto;
  background-color: #F8F8FF;
  padding-left: 70px;
  padding-right: 70px;
}

.header {
  height: 40px;
  background-color: white;
  line-height: 40px;
  border-bottom: 1px solid #598ED1;
}

.info-middle {
  height: 330px;
  background-color: #F8F8FF;
  padding-left: 30px;
  padding-right: 30px;
  padding-bottom: 15px;
}

.titles {
  height: 35px;
  background-color: black;
  line-height: 35px;
  font-size: 1rem;
  color: white;
  padding-left: 10px;
}

.nopadding .ivu-table-cell {
  padding: 0px 0px;
}

.head_btn {
  height: 45px;
  line-height: 45px;
  width: 130px;
  float: left;
  margin-right: 20px;
}

.subsidy-img {
  height: 140px;
  width: 120px;
  position: absolute;
  right: 8%;
  top: 11%;
}

.centerimg {
  text-align: center;
}

.pre_img_style {
  height: 500px;
  width: auto;
  max-width: 500px;
}

.ivu-input[disabled],
fieldset[disabled] .ivu-input {
  background-color: white;
  opacity: 1;
  cursor: not-allowed;
  color: #515A6E;
}
</style>
<template>
  <Layout>
    <div class="layout">
      <div class="titles">办件信息</div>
      <div v-if="formItem.operation">
        <div class="head_btn" v-if="formItem.next_step">
          <Button type="primary" style="margin-right:10px" long @click="nextStep(false)">上一步</Button>
        </div>
        <div class="head_btn" v-if="formItem.next_step">
          <Button type="primary" style="margin-right:10px;background-color:#598ED1;border-color:#598ED1;" long
            @click="saveOrder">保 存
          </Button>
        </div>
        <div class="head_btn" v-if="!formItem.next_step">
          <Button type="primary" style="margin-right:10px" :loading="loading" long @click="nextStep(true)">下一步</Button>
        </div>
        <div class="head_btn" v-if="form_url">
          <Button type="error" style="margin-right:10px;background-color:#79A0D1;border-color:#79A0D1;" long
            @click="downloadPdf">下载PDF
          </Button>
        </div>
      </div>
      <div class="head_btn" v-if="ke_fu != true">
        <Button type="error" style="margin-right:10px;background-color:#235CA7;border-color:#235CA7;" long
          @click="backOrder">返 回
        </Button>
      </div>
    </div>
    <Content class="content">
      <div class="header" v-show="!formItem.operation || !formItem.next_step">
        <span style="font-size: 20px;color: #598ED1 ;">01 事项信息</span>
      </div>
      <div class="info" v-show="!formItem.operation || !formItem.next_step">
        <div class="items">
          <div style="width:40%;float:left">
            <span>事项名称：</span><span>{{ itemData.title }}</span>
          </div>
          <div style="width:50%;float:left">
            <span>事项编码：</span><span>{{ itemData.item_id }}</span>
          </div>
        </div>
        <div class="items">
          <!--          <div style="width:40%;float:left">-->
          <!--            <span>联系电话：</span><span>{{ itemData.LINK_TEL }}</span>-->
          <!--          </div>-->
          <!--          <div style="width:25%;float:left">-->
          <!--            <span>承诺期限：</span><span>{{ itemData.PROMISE_DAY == -1 ? '即办件' : itemData.PROMISE_DAY + '个工作日' }}</span>-->
          <!--          </div>-->
          <!--          <div style="width:35%;float:left">-->
          <!--            <span>办理时间：</span><span>{{ itemData.ACCEPT_TIME }}</span>-->
          <!--          </div>-->
          <!--        </div>-->
          <!--        <div class="items">-->
          <!--          <div style="width:40%;float:left">-->
          <!--            <span>所属部门：</span><span>{{ itemData.jdjg }}</span>-->
          <!--          </div>-->
          <!--          <div style="width:25%;;float:left">-->
          <!--            <span>是否收费：</span><span>{{ itemData.CHARGE_FLAG == '0' ? '不收费' : '收费' }}</span>-->
          <!--          </div>-->
          <!--          <div style="width:35%;;float:left">-->
          <!--            <span>网上办理：</span><span>{{ itemData.is_wsbl == '1' ? '可以' : '不可以' }}</span>-->
          <!--          </div>-->
          <!--        </div>-->
          <!--        <div class="items">-->
          <!--          <div style="width:100%;float:left">-->
          <!--            <span>受理条件：</span><span>{{ itemData.APPLY_CONDITION }}</span>-->
          <!--          </div>-->
          <!--        </div>-->
          <!--        <div class="items">-->
          <!--          <div style="width:100%;float:left">-->
          <!--            <span>补充说明：</span><span>{{ itemData.SXSM }}</span>-->
          <!--          </div>-->
        </div>
        <div style="clear:both;height:1px;width:100%; overflow:hidden; margin-top:-1px;"></div>
      </div>
      <div class="header" v-show="!formItem.operation || !formItem.next_step">
        <span style="font-size: 20px;color: #598ED1 ;">02 办件信息</span>
      </div>
      <div class="info-middle" v-show="!formItem.operation || !formItem.next_step">
        <div style="width:50%;float:left">
          <Form ref="personinfo" :model="personinfo" :label-width="110" style="margin-top:10px">
            <FormItem label="申请人类型: ">
              <RadioGroup v-model="formItem.radio">
                <Radio label="male">个人</Radio>
              </RadioGroup>
            </FormItem>
            <FormItem label="证件类型: " prop="type">
              <Input v-model="personinfo.type" disabled="disabled"></Input>
            </FormItem>
            <FormItem label="证件编号: " prop="code">
              <Input v-model="personinfo.TMcardno" disabled="disabled"></Input>
            </FormItem>
            <FormItem label="民族: ">
              <Input v-model="personinfo.folk" disabled="disabled"></Input>
            </FormItem>
            <FormItem label="现住地址: ">
              <Input v-model="personinfo.present_address" disabled="disabled"></Input>
            </FormItem>
          </Form>
        </div>
        <!--        -->
        <div style="width:50%;float:left">
          <Form ref="personinfo" :model="personinfo" :label-width="100" style="margin-top:10px">
            <FormItem label="申请人: " prop="name">
              <Input v-model="personinfo.name" disabled="disabled"></Input>
            </FormItem>
            <FormItem label="联系电话: ">
              <Input v-model="personinfo.mobile" disabled="disabled"></Input>
            </FormItem>
            <FormItem label="性别: ">
              <Input v-model="personinfo.sex" disabled="disabled"></Input>
            </FormItem>
            <FormItem label="生日: ">
              <Input v-model="personinfo.birthday" disabled="disabled"> </Input>
            </FormItem>
            <FormItem label="政治面貌: ">
              <Input v-model="personinfo.political_outlook" disabled="disabled"></Input>
            </FormItem>
          </Form>
        </div>
      </div>
      <div class="header" v-show="!formItem.operation || formItem.next_step">
        <span style="font-size: 20px;color: #598ED1 ;">03 申报材料</span>
      </div>
      <div style="height: auto; background-color: #F8F8FF;" v-show="!formItem.operation || formItem.next_step">
        <Table v-if="!formItem.reloadTabel" border :columns="columns7" :data="documentlist"></Table>
      </div>
      <div class="header" v-show="!formItem.operation || formItem.next_step">
        <span style="font-size: 20px;color: #598ED1 ;" v-if="infflag == '212000329000'">04 是否使用电子印章</span>
      </div>
      <div style="height: auto; background-color: #F8F8FF;" v-show="!formItem.operation || formItem.next_step" v-if="infflag == '212000329000'">
        <!-- <Switch v-model="Messagevalue" @on-change="Messagevalue1" /> -->
        <RadioGroup style="margin-top:20px;padding-bottom: 20px;margin-left: 10px;" v-model="Messagevalue">
          <Radio label="1" border>是</Radio>
          <Radio label="0" border>否</Radio>
        </RadioGroup>
      </div>
    </Content>

    <Modal v-model="face_mol" title="拍照" @on-visible-change="modalChange" width="700">
      <face-camera :isPlay="face_shows" :extraData="upPicData" :file-path="filePath" :file-name="fileName"
        @img-result="imgResult"></face-camera>
      <div slot="footer">
        <Button type="error" @click="face_mol = false">关闭</Button>
      </div>
    </Modal>
    <Modal v-model="gpy_mol" title="高拍仪" @on-visible-change="modalChange2" @on-cancel="closeHeight" @on-ok="closeHeight">
      <height-camera :isOpen="gpy_shows" :file-path="filePath" :file-name="fileName" :extraData="upPicData"
        @ret-fun="retFun"></height-camera>
    </Modal>
    <Modal v-model="mshow" title="高拍仪" @on-visible-change="modalChange3" @on-cancel="closeHeight1" @on-ok="closeHeight1">
      <wl-equipment :file-path="filePath" :file-name="fileName" v-model="obj" :type="type" :is-open="openNow"
        user_idcard="cardId" ref="wlEquipment" @get_info="imgResult" @change="geyImgUrl"
        @change1="change1"></wl-equipment>
    </Modal>
    <Modal v-model="up_pic_mol" title="图片上传" @on-ok="changeToView" :closable="false">
      <Upload multiple action="http://120.27.63.37:38081/api/ac/file/fileCommonService/upLoadFiles"
        :before-upload="beforeUpload">
        <Button icon="ios-cloud-upload-outline">上传图片</Button>
        <span style="margin-left: 250px">请上传小于8M的图片</span>
      </Upload>
      <img :src="temp_photo" style="width: 100%" />
    </Modal>
    <!-- 图片查看模态框 -->
    <Modal v-model="picPreviewMol.preShow" :closable="false" :styles="{ top: '20px' }" width="532">
      <Carousel v-model="picPreviewMol.picIndex" style="width:500px" dots="outside" trigger="hover">
        <CarouselItem class="centerimg" v-for="(imginfo, index) in picPreviewMol.pic_urls" :key="index">
          <img :id="printNum(index)" :src="imginfo" class="pre_img_style" />
        </CarouselItem>
      </Carousel>
      <div slot="footer" style="text-align: center">
        <div v-if="printShow">
          <Button type="info" @click="originalGraph">下载</Button>
          <!--          <Button type="info" @click="originalGraph">查看原图</Button>-->
          <Button type="error" v-if="formItem.operation" @click="deletePic">删除当前照片</Button>
          <Button @click="picPreviewMol.preShow = false">关闭</Button>
          <Button type="success" v-print="tempIndex" @click="printClick()">打印</Button>
        </div>
      </div>
    </Modal>
    <!-- 居住证明表单 -->
    <Modal v-model="formItem.communityProveShow" :title="formItem.itemInfoFormTitle" width="700" :closable="false">
      <!-- <WlForm :data="formdata111" :value="formdata111" ref="generateForm"></WlForm> -->
      <Form :disabled="!this.formItem.operation" label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">持证者：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input v-model="formItem.itemInfoForm.holder"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">性别：</Col>
          <Col span="12" class="ivu-form-item-content">
          <RadioGroup v-model="formItem.itemInfoForm.xb">
            <Radio label="男"></Radio>
            <Radio label="女"></Radio>
          </RadioGroup>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">证件号码：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input v-model="formItem.itemInfoForm.holder_code"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">主送机关：</Col>
          <Col span="12">
          <Input v-model="formItem.itemInfoForm.sxzm"></Input>
          </Col>
          <Col span="4" class="ivu-form-item-label">
          <span v-if="itemData.item_id == '11210101000000WJJD5212000268000'"
            style="color:red;text-center:left">填写:XX社区</span>
          <span v-else style="color:red;text-center:left">填写:XX房产局</span>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">现住址：</Col>
          <Col span="12">
          <Input type="textarea" v-model="formItem.itemInfoForm.xzz" :autosize="{ minRows: 2, maxRows: 4 }"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">事项内容：</Col>
          <Col span="12">
          <Input type="textarea" v-model="formItem.itemInfoForm.content" :autosize="{ minRows: 2, maxRows: 4 }"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">情况说明：</Col>
          <Col span="12">
          <Input type="textarea" v-model="formItem.itemInfoForm.qtqk" :autosize="{ minRows: 3, maxRows: 6 }"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button type="success" @click="saveJzInfo(true)">确定</Button>
        <Button type="error" @click="formItem.communityProveShow = false">关闭</Button>
      </div>
    </Modal>
    <!-- 证明表单 -->
    <Modal v-model="formItem.communityProveShows" :title="formItem.itemInfoFormTitle" width="700" :closable="false">
      <!-- {{ formItem }} -->
      <Form :disabled="!this.formItem.operation" label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">姓名：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input v-model="formItem.itemInfoForm.name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">性别：</Col>
          <Col span="12" class="ivu-form-item-content">
          <RadioGroup v-model="formItem.itemInfoForm.xb">
            <Radio label="男"></Radio>
            <Radio label="女"></Radio>
          </RadioGroup>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">出生日期：</Col>
          <Col span="12" class="ivu-form-item-content">
          <DatePicker type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="formItem.itemInfoForm.csrq"
            @on-change="handleDateChange"></DatePicker>
          <!-- 123 -->
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">证件号码：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input v-model="formItem.itemInfoForm.cardno"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">民族：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input v-model="formItem.itemInfoForm.nation"></Input>
          </Col>
        </Row>

        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">户籍地址：</Col>
          <Col span="12">
          <Input type="textarea" v-model="formItem.itemInfoForm.domicile" :autosize="{ minRows: 2, maxRows: 4 }"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">居住地址：</Col>
          <Col span="12">
          <Input type="textarea" v-model="formItem.itemInfoForm.address" :autosize="{ minRows: 2, maxRows: 4 }"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">事项内容：</Col>
          <Col span="12">
          <Input type="textarea" v-model="formItem.itemInfoForm.content" :autosize="{ minRows: 2, maxRows: 4 }"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button type="success" @click="saveJzInfos(true)">确定</Button>
        <Button type="error" @click="formItem.communityProveShows = false">关闭</Button>
      </div>
    </Modal>
    <!--PDF打印-->
    <Modal v-model="pdfModal" title="PDF下载" width="1000" :closable="false">
      <Row>
        <Col span="24" id="printMe1" class="ivu-form-item-content" style="text-align: center">
        <embed width="800" height="600" :src="form_url"></embed>
        </Col>
      </Row>
      <div slot="footer">
        <!-- <Button type="success" v-print="'#printMe1'">打印</Button> -->
        <Button type="error" @click="pdfModal = false">关闭</Button>
      </div>
    </Modal>
    <Modal v-model="depositModal" title="沉淀提示" @on-ok="createCopyFiles">
      <p>是否使用历史证件？</p>
    </Modal>
    <Modal v-model="showSampleTable.isshow" title="样表查看" @on-ok="createCopyFiles">
      <img :src="showSampleTable.sample_table" style="width: 100%" />
    </Modal>
    <Modal v-model="life_form" title="生活能力" @cancel="life_form = false" @on-ok="lifeOk">
      <RadioGroup v-model="aid">
        <Radio label="1">自理</Radio>
        <Radio label="2">失能</Radio>
      </RadioGroup>
    </Modal>
    <!--  独生子女父母退休补助费发放对象确认  -->
    <div id="qrcode1" ref="qrcode1" style="position: absolute;margin-top: -12%;"></div>
    <Modal v-model="bangfuModal" title="" width="1000" @cancel="life_form = false" @on-ok="bangfuOk">
      <bangfu></bangfu>
    </Modal>
    <!-- 为中小学生参加社区实践活动出具证明 -->
    <Modal v-model="formItem.student_certificate" title="为中小学生参加社区实践活动出具证明" width="700" :closable="false">
      <Form label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">姓名：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.cardno"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">开始时间：</Col>
          <Col span="12" class="ivu-form-item-content">
          <DatePicker type="date" :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.start_time">
          </DatePicker>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">结束时间：</Col>
          <Col span="12" class="ivu-form-item-content">
          <DatePicker type="date" :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.end_time">
          </DatePicker>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">活动时长（小时）：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.hear"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">参加社会实践、志愿服务内容：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" type="textarea" v-model="formItem.itemInfoForm.content"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button v-id="!this.formItem.operation" type="success" @click="saveStuduntInfo(true)">确定</Button>
        <Button type="error" @click="formItem.student_certificate = false">关闭</Button>
      </div>
    </Modal>
    <!--房屋租赁地址证明-->
    <Modal v-model="formItem.rental_housing" title="房屋租赁地址证明" width="700" :closable="false">
      <Form label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">房屋出租人姓名：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.hire_name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">房屋出租人身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.hire_cardNo"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">房屋出承租人姓名：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.lessee_name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">房屋出承租人身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.lessee_cardNo"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">租赁详细地址：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.address"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button v-id="!this.formItem.operation" type="success" @click="saveLease(true)">确定</Button>
        <Button type="error" @click="formItem.rental_housing = false">关闭</Button>
      </div>
    </Modal>
    <!--集体户居民基本情况核实证明-->
    <Modal v-model="formItem.collective_residents" title="集体户居民基本情况核实证明" width="700" :closable="false">
      <Form label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">推送单位名称：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.company_name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">姓名：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.cardno"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button v-id="!this.formItem.operation" type="success" @click="saveCollectiveResidents(true)">确定</Button>
        <Button type="error" @click="formItem.collective_residents = false">关闭</Button>
      </div>
    </Modal>
    <!-- 居民申请法律援助证明   -->
    <Modal v-model="formItem.legal_aid" title="居民申请法律援助证明" width="700" :closable="false">
      <Form label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">法律援助中心名称：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.company_name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">申请人：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.cardno"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">案件名称：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.case_name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">家庭人均月收入及来源：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.source"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">家庭特殊原因导致困难状况及平均生活水平：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.level"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button v-id="!this.formItem.operation" type="success" @click="saveLegalAid(true)">确定</Button>
        <Button type="error" @click="formItem.legal_aid = false">关闭</Button>
      </div>
    </Modal>
    <!-- 无习练法论功证明   -->
    <Modal v-model="formItem.practice" title="无习练法论功证明" width="700" :closable="false">
      <Form label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">申请人：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.cardno"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">政治面貌：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.political_outlook"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">民族：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.nation"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">学历：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.student"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">工作单位：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.worker"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button v-id="!this.formItem.operation" type="success" @click="savePractice(true)">确定</Button>
        <Button type="error" @click="formItem.practice = false">关闭</Button>
      </div>
    </Modal>
    <!-- 社区义工工时证明   -->
    <Modal v-model="formItem.volunteer" title="社区义工工时证明" width="700" :closable="false">
      <Form label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">申请人：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.cardno"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">活动名称：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.activity_type"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">活动时间：</Col>
          <Col span="12" class="ivu-form-item-content">
          <DatePicker type="date" :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.activity_time">
          </DatePicker>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">活动时长（小时）：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.hour"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button v-id="!this.formItem.operation" type="success" @click="saveVolunteer(true)">确定</Button>
        <Button type="error" @click="formItem.volunteer = false">关闭</Button>
      </div>
    </Modal>
    <!-- 助残证明   -->
    <Modal v-model="formItem.help_disabled" title="助残证明" width="700" :closable="false">
      <Form label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">申请人：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.cardno"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">单位名称：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.unit_name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">开始时间：</Col>
          <Col span="12" class="ivu-form-item-content">
          <DatePicker type="date" :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.start_time">
          </DatePicker>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">结束时间：</Col>
          <Col span="12" class="ivu-form-item-content">
          <DatePicker type="date" :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.end_time">
          </DatePicker>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">残疾人姓名：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.disabled_name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">残疾人身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.disabled_cardno"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button v-id="!this.formItem.operation" type="success" @click="saveHelpDisabled(true)">确定</Button>
        <Button type="error" @click="formItem.help_disabled = false">关闭</Button>
      </div>
    </Modal>
    <!-- 政审类证明   -->
    <Modal v-model="formItem.political_trial" title="助残证明" width="700" :closable="false">
      <Form label-position="right" :label-width="100">
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">申请人：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.name"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">身份证号：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.cardno"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">政治面貌：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.politics"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">民族：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.nation"></Input>
          </Col>
        </Row>
        <Row class="mb20">
          <Col span="7" class="ivu-form-item-label">工作单位：</Col>
          <Col span="12" class="ivu-form-item-content">
          <Input :disabled="!this.formItem.operation" v-model="formItem.itemInfoForm.worker_name"></Input>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button v-id="!this.formItem.operation" type="success" @click="savePoliticalTrial(true)">确定</Button>
        <Button type="error" @click="formItem.political_trial = false">关闭</Button>
      </div>
    </Modal>
    <div>
    </div>
  </Layout>
</template>
<script>
import GllrbtForm from './components/gllrbtForm'
import FaceCamera from '_c/face2-camera'
import HeightCamera from '_c/height2-camera'
import WlForm from '_c/wl-form'
import {
  userinfo,
  iteminf,
  createOrder,
  updateOrder,
  getMailLevelList,
  getSQCodeFc,
  createDisabilityApi,
  createCopyFiles,
  getDepositInfo,
  authentication,
  repeatApplicationValidation,
  checkDisabilityCertificateAll
} from '@/api/eventlist'
import { getSign, createUpLoadFiles } from '@/api/common'
import nophoto from '@/assets/images/nophoto.jpeg'
import SplitPane from '@/components/split-pane/split'
import DisabledApply from './components/disabledApplay'
import UnemploymentItem from './components/UnemploymentItem'
import JobItem from './components/jobItem'
import insuredRegisterForm from './components/rsForm/insuredRegister'
import insuredChangeForm from './components/rsForm/insuredChange'
import insuredItemForm from './components/rsForm/insuredItem'
import HandleCertificate from './components/entrepreneurship'
import checkCardItem from './components/checkCardItem'
import recruitItem from './components/recruitItem'
import flexibleregister from './components/flexible-register'
import temporaryAssistance from './components/temporaryAssistance'
import WlEquipment from '@/components/wl-equipment/index'
import childwelfare from './components/childwelfare'
import personForm from './components/personInfo'
import personFormTest from './components/personinfoTest'
import Disability from './components/disability/index'
import QRCode from 'qrcodejs2'
import purchaseHomeCare from './components/purchaseHomeCare'
import * as imageConversion from 'image-conversion'

export default {
  name: 'handinformation',
  data() {
    return {
      Messagevalue: "1",
      items: {},
      infflag: '',
      itemsss: false,
      bangfuModal: false,
      life_form: false,
      aid: '',
      ruleValidate: {
        xm: [
          { required: true, message: 'The name cannot be empty', trigger: 'blur' }
        ]
      },
      ke_fu: this.$route.params.ke_fu || false,
      interval: '',
      cardDeviceFlag: true,
      communityProveShows: false,
      printIndex: '',
      buttonInfo: '',
      buttonState: '',
      depositModal: false,
      depositInfo: {},
      ruleData: {},
      disabledLevel: '',
      funeralPersonnelFlag: '',
      disabledPerson: '',
      DISABLED_NUMBER: '',
      CJR_ALLOCATION_ID_NAME: '',
      FIRST_TIME: '',
      formDate: Object,
      sectionList: [],
      sectionListb: [],
      sectionListc: [],
      disabledListb: [],
      disabledListc: [],
      dbForminfo: {
        Year: '',
        Month: ''
      },
      showSampleTable: {
        isshow: false
      },
      dbMonthList: [],
      dbModal: false,
      cardno: '',
      subsidies: '',
      pdfModal: false,
      form_url: '', // 打印pdf地址
      loading: false,
      timeStep: '', // 时间戳
      severUserInfo: {},
      disabledAuxiliaryInfo: {},
      personFormInfo: {
        card_type: '1'
      },
      obj: {},
      mshow: false,
      cardId: '',
      type: 'heightCamera',
      filePath: '', // 上传图片地址
      fileName: '', // 上传图片名称
      openNow: false,
      readStatus: false,
      faceStatus: false,
      name: '',
      time1: '',
      info: {},
      fruit: [],
      // 事项详细信息(01 事项信息)
      itemData: {},
      unemploymentItem1: {},
      // 办理人员信息(02 办件信息)/
      personinfo: {},
      // 申报材料列表(03 申报材料)
      documentlist: [],
      // 拍照弹出框控制器
      face_mol: false,
      // 控制打开or关闭拍照功能
      face_shows: false,
      // 高拍仪弹出框控制器
      gpy_mol: false,
      // 控制打开or关闭高拍仪功能
      gpy_shows: false,
      up_pic_mol: false,
      upPicData: {},
      // 图片要件预览临时变量
      temp_photo: '',
      // 图片要件预览弹出框控制器
      picPreviewMol: {
        preShow: false,
        pic_urls: [],
        picIndex: 0
      },
      nophoto,
      // 页面内其他的功能变量
      formItem: {
        // 跳入当前页面时，需要的操作，true添加或编辑 false查看
        student_certificate: false,
        rental_housing: false,
        collective_residents: false,
        legal_aid: false,
        practice: false,
        volunteer: false,
        help_disabled: false,
        political_trial: false,
        operation: '',
        next_step: false,
        a: '低保残疾人',
        b: '生活补贴',
        reloadTabel: false,
        // 在点击申报材料后面按钮时，记录当前要件在列表的索引位置
        paramIndex: 0,
        radio: 'male',
        // 弹出框标题
        itemInfoFormTitle: '',
        communityProveShow: false,
        parentFormShow: false,
        unemploymentShow: false,
        communityProveShows: false,
        recruitShow: false,
        state: 0,
        // 弹出框内容
        itemInfoForm: {
          agc117: '',
          aaa121: '',
          aaa120: '',
          aca050: '',
          aca051: '',
          aca052: '',
          aca053: '',
          aca054: '',
          aca055: '',
          aca056: '',
          aca057: '',
          aca058: '',
          aca059: ''
        }
      },
      disForm: {
        itemInfo: {}
      },
      // 申报材料表头
      columns7: [
        { title: '序号', type: 'index', width: 70, align: 'center' },
        { title: '材料名称', key: 'name', width: 200 },
        { title: '是否必填', key: 'necessary_name', align: 'center', width: 90 },
        { title: '要件类型', key: 'type_name', align: 'center', width: 100 },
        { title: '是否提交', key: 'is_submit', align: 'center', width: 90 },
        { title: '备注', key: 'remark', width: 260 },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          className: 'nopadding',
          render: (h, params) => {
            let temp = []
            // console.log(this.necessary_name, '@@@@@@')
            if ((this.necessary_name !== '必填') || (this.buttonState === '0' && params.row.necessary_name === '非必填')) {
              if (params.row.write_type === 'images') {
                if (this.formItem.operation) {
                  temp.push(
                    h('Button', {
                      props: { type: 'primary', size: 'small' },
                      style: { marginRight: '5px' },
                      on: {
                        click: () => {
                          if (this.severUserInfo.email === 'JieYuDevice') {
                            this.gpy_mol = true
                            this.gpy_shows = true
                          } else {
                            this.type = 'heightCamera'
                            this.mshow = true
                            this.openNow = true
                          }
                          this.upPicData.fileName = params.row.name + this.datetime2str(new Date()) + '.png'
                          this.fileName = params.row.name.substring(0, 20) + this.datetime2str(new Date()) + '.png'
                          this.upPicData.filePath = 'itemorder/' + this.personinfo.id + '/' + this.$route.params.code
                          this.filePath = this.upPicData.filePath
                          this.formItem.paramIndex = params.index
                        }
                      }
                    }, '高拍仪')
                  )
                  temp.push(
                    h('Button', {
                      props: { type: 'primary', size: 'small' },
                      style: { marginRight: '5px' },
                      on: {
                        click: () => {
                          if (this.severUserInfo.email === 'JieYuDevice') {
                            this.face_mol = true
                            this.face_shows = true
                          } else {
                            this.getIdCardInfo(2)
                          }
                          this.upPicData.fileName = params.row.name + this.datetime2str(new Date()) + '.png'
                          this.fileName = params.row.name.substring(0, 20) + this.datetime2str(new Date()) + '.png'
                          this.upPicData.filePath = 'itemorder/' + this.personinfo.id + '/' + this.$route.params.code
                          this.filePath = this.upPicData.filePath
                          this.formItem.paramIndex = params.index
                        }
                      }
                    }, '拍照')
                  )
                  temp.push(
                    h('Button', {
                      props: { type: 'primary', size: 'small' },
                      style: { marginRight: '5px' },
                      on: {
                        click: () => {
                          console.log(params.index, '下标')
                          this.up_pic_mol = true
                          this.upPicData.fileName = params.row.name + this.datetime2str(new Date())
                          this.upPicData.filePath = 'itemorder/' + this.personinfo.id + '/' + this.$route.params.code
                          this.formItem.paramIndex = params.index
                          this.temp_photo = ''
                        }
                      }
                    }, '上传')
                  )
                  temp.push(
                    h('Button', {
                      props: { type: 'error', size: 'small' },
                      style: { marginRight: '5px' },
                      on: {
                        click: () => {
                          this.formItem.paramIndex = params.index
                          this.getDepositInfo(params.row)
                        }
                      }
                    }, '查找历史证件')
                  )
                }
                if (params.row.is_submit === '已提交') {
                  temp.push(
                    h('Button', {
                      props: { type: 'info', size: 'small' },
                      style: { marginRight: '5px' },
                      on: {
                        click: () => {
                          this.picPreviewMol.pic_urls = params.row.img_urls
                          this.picPreviewMol.preShow = true
                          this.picPreviewMol.picIndex = 0
                          this.formItem.paramIndex = params.index
                        }
                      }
                    }, this.formItem.operation ? '预览' : '查看')
                  )
                }
              } else if (params.row.write_type === 'form') {
                temp.push(
                  h('Button', {
                    props: { type: 'info', size: 'small' },
                    style: { marginRight: '5px' },
                    on: {
                      click: () => {
                        this.formItem.paramIndex = params.index
                        this.showFormInfo(params.row)
                      }
                    }
                  }, this.formItem.operation ? '编辑' : '查看')
                )
              }
            } else {
              console.log('必填')
            }
            if (params.row.sample_table) {
              temp.push(
                h('Button', {
                  props: { type: 'info', size: 'small' },
                  style: { marginRight: '5px' },
                  on: {
                    click: () => {
                      this.showSampleTablef(params.row)
                    }
                  }
                }, '查看样表')
              )
            }
            return h('div', temp)
          }
        }
      ],
      printShow: true
    }
  },
  computed: {
    companyCode() {
      return this.$store.state.user.severUserInfo.company_code
    }
  },
  components: {
    Disability,
    // eslint-disable-next-line vue/no-unused-components
    SplitPane,
    FaceCamera,
    HeightCamera,
    // eslint-disable-next-line vue/no-unused-components
    WlForm,
    DisabledApply,
    UnemploymentItem,
    JobItem,
    insuredRegisterForm,
    insuredChangeForm,
    insuredItemForm,
    HandleCertificate,
    checkCardItem,
    // eslint-disable-next-line vue/no-unused-components
    recruitItem,
    flexibleregister,
    temporaryAssistance,
    WlEquipment,
    childwelfare,
    personForm,
    purchaseHomeCare,
    GllrbtForm,
    personFormTest
  },
  methods: {
    // 是否使用电子印章
    Messagevalue1(status) {

    },
    handleDateChange(date) {
      // Ensure that date is a Date object
      if (!(date instanceof Date)) {
        // If it's not a Date object, try to create one
        date = new Date(date);
      }

      // Check if date is a valid Date object
      if (!isNaN(date.getTime())) {
        // Format the date and update the variable
        this.formItem.itemInfoForm.csrq = this.formatDate(date);
      }
    },
    formatDate(date) {
      // Format the date as "yyyy-MM-dd"
      const year = date.getFullYear();
      const month = String(date.getMonth() + 1).padStart(2, '0');
      const day = String(date.getDate()).padStart(2, '0');
      return `${year}-${month}-${day}`;
    },
    bangfuOk() {

    },
    lifeOk() {
      console.log(this.aid)
    },
    printClick() {
      this.printShow = false
      let that = this
      setTimeout(function () {
        that.printShow = true
      }, 5000)
    },
    printNum(e) {
      this.printIndex = e
      return e
    },
    tempIndex() {
      return '#' + this.printIndex
    },
    showErcode(codeUrl) {
      console.log(codeUrl)
      let _this = this
      console.log(codeUrl)
      setTimeout(function () {
        _this.getCode(codeUrl[0])
      }, 1000)
    },
    getCode(codeUrl) {
      document.getElementById('qrcode1').innerHTML = ''
      var qrcode = new QRCode(document.getElementById('qrcode1'), {
        text: codeUrl,
        top: 0,
        width: 150,
        height: 150,
        colorDark: '#000000',
        colorLight: '#ffffff',
        correctLevel: QRCode.CorrectLevel.H
      })
      console.log(qrcode, 'qrcode')
    },
    getDepositInfo: function (obj) {
      console.log(this.code, 999)
      let data = {
        card_no: this.cardno,
        document_name: obj.value,
        code: this.$route.params.code
      }
      getDepositInfo(data).then(ret => {
        if (ret.data.errcode === 0) {
          if (ret.data.data === null) {
            this.$Notice.error({ title: '失败', desc: '未查询到要件信息' })
          } else {
            this.depositModal = true
            this.depositInfo = ret.data.data
          }
        } else {
          this.$Notice.error({ title: '失败', desc: ret.data.errmsg + '或沉淀要件已过期' })
        }
      })
    },
    showSampleTablef: function (obj) {
      console.log(obj, 999)
      this.showSampleTable.isshow = true
      this.showSampleTable.sample_table = obj.sample_table
    },
    createCopyFiles() {
      let data = {
        filePath: 'itemorder/' + this.personinfo.id + '/' + this.$route.params.code,
        file: this.depositInfo.document_url
      }
      createCopyFiles(data).then(ret => {
        if (ret.data.errcode === 0) {
          let info = JSON.parse(ret.data.data.uploadurl)
          if (info.errcode === 0) {
            let list = this.documentlist[this.formItem.paramIndex]
            if (list.img_urls) {
              list.img_urls.push(info.data)
            } else {
              list.img_urls = [info.data]
            }
            this.changeToView()
            // this.temp_photo = info.data
            // let temp = this.documentlist[this.formItem.paramIndex]
            // temp.is_submit = '已提交'
          } else {
            this.$Notice.error({ title: '失败', desc: ret.data.errmsg })
          }
        } else {
          this.$Notice.error({ title: '失败', desc: ret.data.errmsg })
        }
      })
    },
    getIdCardInfo(type) {
      console.log('!!!@!@')
      if (type === 1) {
        console.log('!!@!@!@!')
        this.type = 'idcard'
        this.$refs.wlEquipment.getResult()
      }
      if (type === 2) {
        this.type = 'faceCamera'
        this.mshow = true
        this.openNow = true
      }
    },
    TakePhoto() {
      this.mshow = true
      this.openNow = true
    },
    // imgResult (idcard) {
    //   this.getUserInfo(idcard)
    //   this.userOrderList(idcard)
    //   this.faceStatus = false
    // },
    // 招聘登记
    saveRecruit() {
      this.$refs.recruitChild.test()
      return true
    },
    // 年审组件回传参数
    checkDatas(data) {
      this.checkForm.itemInfo = data
    },
    checkPersonDataTest(item) {
      console.log('test')
      // this.checkForm.itemInfo = data
    },
    // 招聘回传参数
    recruit(data) {
      this.recruitItem.itemInfo = data
      this.formItem.recruitShow = false
    },
    // 创业证组件回传参数
    handlecertificateItem(data) {
      this.handleItem.itemInfo = data
    },
    // 灵活就业回传参数
    flexibleregisterItem(data) {
      this.flexItem.itemInfo = data
    },
    // 临时救助
    temporaryAssistanceItem(data) {
      this.temporaryItem.itemInfo = data
    },
    // 儿童救助传回参数
    childItem(data) {
      this.childwelfareItem.itemInfo = data
    },
    // 申请低收入一级残疾人专项救助
    disItem(data) {
      this.disForm.itemInfo = data
    },
    // 个人求职登记子组件传过来的值
    jobb(data) {
      this.jobItem.itemInfo = data
    },
    gllrbtShow(data) {
      // alert("1")
      this.formItem.itemInfoForm = data
    },
    purchaseHomeShow(data) {
      this.formItem.itemInfoForm = data
    },
    // 失业登记子组件回传参数
    unemp(data) {
      this.unemploymentItem.itemInfo = data
    },
    // 时间转字符串 年月日时分秒
    datetime2str(date) {
      let time1 = date.getFullYear() + ''
      let month = date.getMonth() + 1
      let day = date.getDate()
      let hh = date.getHours()
      let mm = date.getMinutes()
      let ss = date.getSeconds()
      time1 += month < 10 ? '0' + month : month
      time1 += day < 10 ? '0' + day : day
      time1 += hh < 10 ? '0' + hh : hh
      time1 += mm < 10 ? '0' + mm : mm
      time1 += ss < 10 ? '0' + ss : ss
      return time1
    },
    modalChange(e) {
      this.face_shows = e
    },
    modalChange2(e) {
      this.gpy_shows = e
    },
    modalChange3(e) {
      this.openNow = e
    },
    // 页面内提交材料发生变化时刷新表格数据动态
    changeToView() {
      this.formItem.reloadTabel = true
      let temp = this.documentlist[this.formItem.paramIndex]
      if (temp.img_urls || temp.write_type === 'form') {
        temp.is_submit = '已提交'
      }
      this.$nextTick(() => {
        this.formItem.reloadTabel = false
      })
    },
    savePoliticalTrial(flag) {
      let telval2 = /([1-9]\d{5}(((1[89]|20)\d{2}(((0[13578]|1[0-2])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((((1[89]|20)(0[48]|[2468][048]|[13579][26]))|((19|20)00))0229))\d{3}(\d|X|x))/
      let card = this.formItem.itemInfoForm.cardno
      if (!telval2.test(card)) {
        console.log(1122)
        this.$Notice.error({ title: '身份证校验不合规', desc: '' })
        return false
      }
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.formItem.political_trial = false
      this.changeToView()
      return true
    },
    saveHelpDisabled(flag) {
      let telval2 = /([1-9]\d{5}(((1[89]|20)\d{2}(((0[13578]|1[0-2])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((((1[89]|20)(0[48]|[2468][048]|[13579][26]))|((19|20)00))0229))\d{3}(\d|X|x))/
      let card = this.formItem.itemInfoForm.cardno
      if (!telval2.test(card)) {
        console.log(1122)
        this.$Notice.error({ title: '身份证校验不合规', desc: '' })
        return false
      }
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.formItem.help_disabled = false
      this.changeToView()
      return true
    },
    saveVolunteer(flag) {
      let telval2 = /([1-9]\d{5}(((1[89]|20)\d{2}(((0[13578]|1[0-2])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((((1[89]|20)(0[48]|[2468][048]|[13579][26]))|((19|20)00))0229))\d{3}(\d|X|x))/
      let card = this.formItem.itemInfoForm.cardno
      if (!telval2.test(card)) {
        console.log(1122)
        this.$Notice.error({ title: '身份证校验不合规', desc: '' })
        return false
      }
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.formItem.volunteer = false
      this.changeToView()
      return true
    },
    savePractice(flag) {
      let telval2 = /([1-9]\d{5}(((1[89]|20)\d{2}(((0[13578]|1[0-2])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((((1[89]|20)(0[48]|[2468][048]|[13579][26]))|((19|20)00))0229))\d{3}(\d|X|x))/
      let card = this.formItem.itemInfoForm.cardno
      if (!telval2.test(card)) {
        console.log(1122)
        this.$Notice.error({ title: '身份证校验不合规', desc: '' })
        return false
      }
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.formItem.practice = false
      this.changeToView()
      return true
    },
    saveLegalAid(flag) {
      let telval2 = /([1-9]\d{5}(((1[89]|20)\d{2}(((0[13578]|1[0-2])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((((1[89]|20)(0[48]|[2468][048]|[13579][26]))|((19|20)00))0229))\d{3}(\d|X|x))/
      let card = this.formItem.itemInfoForm.cardno
      if (!telval2.test(card)) {
        console.log(1122)
        this.$Notice.error({ title: '身份证校验不合规', desc: '' })
        return false
      }
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.formItem.legal_aid = false
      this.changeToView()
      return true
    },
    saveCollectiveResidents(flag) {
      let telval2 = /([1-9]\d{5}(((1[89]|20)\d{2}(((0[13578]|1[0-2])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((((1[89]|20)(0[48]|[2468][048]|[13579][26]))|((19|20)00))0229))\d{3}(\d|X|x))/
      let card = this.formItem.itemInfoForm.cardno
      if (!telval2.test(card)) {
        console.log(1122)
        this.$Notice.error({ title: '身份证校验不合规', desc: '' })
        return false
      }
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.formItem.collective_residents = false
      this.changeToView()
      return true
    },
    saveLease(flag) {
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.formItem.rental_housing = false
      this.changeToView()
      return true
    },
    saveStuduntInfo(flag) {
      if (!this.formItem.itemInfoForm.name) {
        this.$Notice.error({ title: '请填写姓名', desc: '' })
        return false
      }
      if (!this.formItem.itemInfoForm.cardno) {
        this.$Notice.error({ title: '请填写证件号码', desc: '' })
        return false
      }
      if (!this.formItem.itemInfoForm.content) {
        this.$Notice.error({ title: '请填写参加社会实践、志愿服务内容', desc: '' })
        return false
      }
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.formItem.student_certificate = false
      this.changeToView()
      return true
    },
    // 社区证明事项的表单信息校验
    saveJzInfo(flag) {
      if (!this.formItem.itemInfoForm.holder) {
        this.$Notice.error({ title: '请填写持证者', desc: '' })
        return false
      }
      if (!this.formItem.itemInfoForm.xb) {
        this.$Notice.error({ title: '请填写性别', desc: '' })
        return false
      }
      if (!this.formItem.itemInfoForm.holder_code) {
        this.$Notice.error({ title: '请填写证件号码', desc: '' })
        return false
      }
      if (!this.formItem.itemInfoForm.sxzm) {
        this.$Notice.error({ title: '请填写所需证明', desc: '' })
        return false
      }
      if (!this.formItem.itemInfoForm.xzz) {
        this.$Notice.error({ title: '请填写现住址', desc: '' })
        return false
      }
      if (!this.formItem.itemInfoForm.qtqk) {
        this.$Notice.error({ title: '请填写其他情况', desc: '' })
        return false
      }
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.formItem.communityProveShow = false
      this.changeToView()
      return true
    },
    saveJzInfos(flag) {
      if (flag) {
        this.documentlist[this.formItem.paramIndex].formdata = this.formItem.itemInfoForm
      }
      this.items = this.formItem.itemInfoForm
      // console.log(this.items,"sss")
      this.itemsss = true
      this.formItem.communityProveShows = false
      this.changeToView()
      return true
    },
    isDuringDate(birthday) {
      var curDate = new Date()
      var beginDate = curDate.getFullYear() - 3
      var endDate = beginDate - 3
      birthday = new Date(birthday)
      beginDate = new Date(beginDate + '09-01')
      endDate = new Date(endDate + '08-31')

      if (birthday >= beginDate && birthday <= endDate) {
        return true
      }
      return false
    },
    CheckIsNullOrEmpty(value) {
      // 返回值为true表示不是空字符串
      return (value !== null && value !== undefined)
    },
    // 新高拍仪拍照回调函数
    change1(data) {
      if (data.url) {
        // this.mshow = false
        // this.openNow = false
        let list = this.documentlist[this.formItem.paramIndex]
        if (list.img_urls) {
          list.img_urls.push(data.url)
        } else {
          list.img_urls = [data.url]
        }
        this.changeToView()
      } else {
        this.$Notice.error({ title: '拍照失败,请重新拍摄' })
      }
    },
    // 拍照回调函数
    imgResult(data) {
      if (data.url) {
        this.face_mol = false
        this.face_shows = false
        let list = this.documentlist[this.formItem.paramIndex]
        if (list.img_urls) {
          list.img_urls.push(data.url)
        } else {
          list.img_urls = [data.url]
        }
        this.changeToView()
      } else {
        this.$Notice.error({ title: '拍照失败,请重新拍摄' })
      }
    },
    // 高拍仪保存函数
    retFun(data) {
      if (data.url) {
        this.gpy_mol = false
        this.gpy_shows = false
        let list = this.documentlist[this.formItem.paramIndex]
        if (list.img_urls) {
          list.img_urls.push(data.url)
        } else {
          list.img_urls = [data.url]
        }
        this.changeToView()
      } else {
        this.$Notice.error({ title: '拍照失败,请重新拍摄' })
      }
    },
    // 新设备高拍仪保存函数
    geyImgUrl(data) {
      if (data.url) {
        this.gpy_mol = false
        this.gpy_shows = false
        let list = this.documentlist[this.formItem.paramIndex]
        if (list.img_urls) {
          list.img_urls.push(data.url)
        } else {
          list.img_urls = [data.url]
        }
        this.changeToView()
      } else {
        this.$Notice.error({ title: '拍照失败,请重新拍摄' })
      }
    },
    // 把图片文件作为参数传递到方法中进行压缩
    beforeAvatarUpload(file) {
      const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
      if (!isJpgOrPng) {
        this.$Notice.error({ title: '上传失败', desc: '上传头像图片只能是 JPG 或 PNG 格式!' })
        return false
      }
      return new Promise(() => {
        imageConversion.compressAccurately(file, 200).then(res => {
          let that = this
          const reader = new FileReader()
          reader.readAsDataURL(new File([res], '', { type: res.type, lastModified: Date.now() }))
          reader.onload = () => {
            let index = reader.result.indexOf('base64,') + 7
            that.upPicData.fileName = this.upPicData.fileName + '.' + file.type.substring(6)
            that.upPicData.file = reader.result.substring(index)
            that.upPic(that.upPicData)
          }
        })
      })
    },
    // 上传图片前转base64
    beforeUpload(file) {
      // var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
      console.log(file, '图片文件')
      // const item_id = ['11210101000000RSJD5212000233000', '11210101000000MZJD5212000474000', '11210101000000MZJD5212000475000']
      if (file.size / 1024 / 1024 > 1) { // 超过1M 压缩 图片为200K
        return this.beforeAvatarUpload(file)
      }
      const isLt2M = file.size / 1024 / 1024 < 8
      console.log(isLt2M)
      if (!isLt2M) {
        this.$Notice.error({ title: '上传失败', desc: '请上传图片小于8M的图片' })
        return
      }
      // return isLt2M
      this.upPicData.fileName = this.upPicData.fileName + '.' + file.type.substring(6)
      let that = this
      const reader = new FileReader()
      reader.readAsDataURL(file)
      reader.onload = () => {
        let index = reader.result.indexOf('base64,') + 7
        that.upPicData.file = reader.result.substring(index)
        that.upPic(that.upPicData)
      }
      return false
    },
    // 上传图片
    upPic(obj) {
      var time = new Date().getTime()
      this.timeStep = time.toString()
      let param = {
        filePath: obj.filePath,
        fileName: obj.fileName,
        timestamp: this.timeStep
      }
      if (param.fileName.length > 20) {
        param.fileName = param.fileName.substring(0, 20) + '.png'
      }
      getSign(param).then(res => {
        if (res.data.errcode === 0) {
          createUpLoadFiles(res.data.data.docking_url, {
            sign: res.data.data.sign,
            timestamp: this.timeStep,
            filePath: param.filePath,
            fileName: param.fileName,
            file: obj.file
          }).then(res => {
            if (res.data.errcode === 0) {
              let imgurl = res.data.data
              imgurl = imgurl.replace('http://anshandl.qstb.top:8000/', 'http://172.20.10.134:9864/')
              let list = this.documentlist[this.formItem.paramIndex]
              if (list.img_urls) {
                list.img_urls.push(imgurl)
              } else {
                list.img_urls = [imgurl]
              }
              this.temp_photo = imgurl
              console.log(this.formItem.operation)
              console.log(this.documentlist[this.formItem.paramIndex], 'documern')
            } else {
              this.$Notice.error({ title: '上传失败', desc: res.data.data.msg })
            }
          })
        } else {
          this.$Notice.error({ title: '上传失败', desc: res.data.data.msg })
        }
      })
    },
    parentFormShowInfo() {
      let param = {
        name: this.personinfo.name,
        cardno: this.$route.params.cardno,
        item_id: this.itemData.item_id
      }
      authentication(param).then(res => {
        if (res.data.errcode === 0) {
          this.ruleData = res.data.data.data
          if (res.data.data.code !== '1') {
            this.$Notice.error({ title: '获取人员信息失败', desc: res.data.data.msg })
            return
          }
          this.formItem.parentFormShow = true
        }
      })
    },
    // 全部表单弹出框的入口
    showFormInfo(item) {
      // console.log(item,"弹出")
      // console.log(this.personinfo,"表单数据")
      // return
      if (!this.itemData.form_params) {
        if (item.form_path === 'studentFormShow3' || item.form_path === 'studentFormShow4') {
          this.parentFormShowInfo()
          this.formItem.itemInfoFormTitle = item.name
          return
        }
      } else if (item.form_path === 'studentFormShow3' || item.form_path === 'studentFormShow4') {
        var form_param = JSON.parse(this.itemData.form_params)
        if (form_param.aac003 === undefined || form_param.aac003 === '') {
          this.parentFormShowInfo()
          this.formItem.itemInfoFormTitle = item.name
          return
        }
      }

      this.formItem[item.form_path] = true
      this.formItem.itemInfoFormTitle = item.name
      if (this.itemData.form_params) { // 编辑
        this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        console.log(this.formItem.itemInfoForm, '表单数据1')
        // this.personFormInfo = this.formItem.itemInfoForm
      }

      if (item.form_path === 'life_form') {
        this.life_form = true
        this.formItem.itemInfoForm.aid = this.personinfo.aid || ''
      }
      if (item.form_path === 'communityProveShow') {
        // 居住证明表单[婚育证明]
        // this.formItem.itemInfoForm.sxzm = '主送单位'
        // this.formItem.itemInfoForm.qtqk = '本人确认在此社区居住'
        this.formItem.itemInfoForm.holder = this.personinfo.name || ''
        this.formItem.itemInfoForm.xb = this.personinfo.sex || ''
        this.formItem.itemInfoForm.holder_code = this.$route.params.cardno || ''
        this.formItem.itemInfoForm.xzz = this.personinfo.present_address || this.formItem.itemInfoForm.xzz
        if (this.itemData.item_id === '11210101000000WJJD5212000268000') {
          let index1 = this.severUserInfo.company_name.indexOf('街道')
          this.formItem.itemInfoForm.sxzm = this.severUserInfo.company_name.substring(index1 + 2)
        }
      } else if (item.form_path === 'student_certificate') {
        this.formItem.itemInfoForm.name = this.personinfo.name || ''
        this.formItem.itemInfoForm.xb = this.personinfo.sex || ''
        this.formItem.itemInfoForm.cardno = this.$route.params.cardno || ''
        this.formItem.itemInfoForm.address = this.personinfo.present_address || this.formItem.itemInfoForm.xzz
        this.formItem.student_certificate = true
      }
      else if (item.form_path === 'rental_housing') {
        this.formItem.rental_housing = true
      } else if (item.form_path === 'communityProveShows') {
        this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
      } else if (item.form_path === 'collective_residents') {
        this.formItem.collective_residents = true
      } else if (item.form_path === 'legal_aid') {
        this.formItem.legal_aid = true
      } else if (item.form_path === 'practice') {
        this.formItem.practice = true
      } else if (item.form_path === 'volunteer') {
        this.formItem.volunteer = true
      } else if (item.form_path === 'help_disabled') {
        this.formItem.help_disabled = true
      } else if (item.form_path === 'political_trial') {
        this.formItem.political_trial = true
      } else if (item.form_path === 'dbFrom') {
        var date = new Date()
        if (this.itemData.form_params === null) {
          var list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
          this.dbForminfo.Year = date.getFullYear()
          this.dbMonthList = list.slice(0, date.getMonth() + 1)
        } else {
          this.dbForminfo = JSON.parse(this.itemData.form_params)
        }
        if (this.dbForminfo.Month === '' || this.dbForminfo.Year === '' || this.dbForminfo.Month === null || this.dbForminfo.Year === null) {
        } else {
          var list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
          this.dbMonthList = list1.slice(0, this.dbForminfo.Month)
        }

        this.dbModal = true
      } else if (item.form_path === 'disModal') {
        // this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        this.$refs.child.init(this.itemData.form_params)
        this.disModal = true
      } else if (item.form_path === 'disModal1') { // 测试残疾人一级证办理
        if (this.itemData.form_params) { // 编辑
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        } else {
          this.getValidateRules3(this.personinfo.name, this.$route.params.cardno)
        }
      } else if (item.form_path === 'temporaryAssistanceShow') {
        // 临时救助
        this.time1 = new Date()
        this.time1 = date2str(this.time1)
        this.unemploymentItem1 = JSON.parse(this.itemData.form_params)
        this.unemploymentItem.itemInfo = this.unemploymentItem1
      } else if (item.form_path === 'childwelfareShow') {
        // 儿童福利表
        this.unemploymentItem1 = JSON.parse(this.itemData.form_params)
        this.childwelfareItem.itemInfo = this.unemploymentItem1
      } else if (item.form_path === 'unemploymentShow') {
        // 失业登记表单
        // console.log('@#！@#@！#！@#！#！@')
        this.unemploymentItem1 = JSON.parse(this.itemData.form_params)
        this.unemploymentItem.itemInfo = this.unemploymentItem1
      } else if (item.form_path === 'handlecertificateShow') {
        // 就业创业证
        if (this.itemData.form_params) {
          this.unemploymentItem1 = JSON.parse(this.itemData.form_params)
        }
        this.documentlist.forEach(element => {
          if (element.write_type === 'images' && element.img_urls) {
            if (element.document_id === 370) {
              this.unemploymentItem1.acc0mg = element.img_urls.toString()
              this.unemploymentItem1.apiName = 'sq4jycyz'
            }
          }
        })
        this.handleItem.itemInfo = this.unemploymentItem1
      } else if (item.form_path === 'checkShow') {
        // 年审
        this.unemploymentItem1 = JSON.parse(this.itemData.form_params)
        this.handleItem.itemInfo = this.unemploymentItem1
      } else if (item.form_path === 'flexibleregisterShow') {
        // 灵活登记
        this.unemploymentItem1 = JSON.parse(this.itemData.form_params)
        this.handleItem.itemInfo = this.unemploymentItem1
      } else if (item.form_path === 'recruitShow') {
        // 空岗录入
        this.unemploymentItem1 = JSON.parse(this.itemData.form_params)
        this.handleItem.itemInfo = this.unemploymentItem1
      } else if (item.form_path === 'jobShow') {
        // 个人求职
        this.unemploymentItem12 = JSON.parse(this.itemData.form_params)
        this.handleItem.itemInfo = this.unemploymentItem12
      } else if (item.form_path === 'OldAgeAllowanceShow') {
        // 沈阳老人
        // console.log(this.itemData.form_params, '@@@@@')
        if (this.itemData.form_params) {
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        } else {
          this.$refs.gllrbtItem.savePersonInfo(this.personinfo)
        }
        // console.log(this.formItem.itemInfoForm, 'this.formItem.itemInfoForm') // 单项保存,清空表
        if (this.itemData.form_params) {
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
          // console.log(this.formItem.itemInfoForm, 'this.formItem.itemInfoForm') // 单项保存,清空表
        }
      } else if (item.form_path === 'deathProveShow') {
        if (this.formItem.itemInfoForm.jmlx) {
          this.formItem.itemInfoForm.jmlx_a = this.formItem.itemInfoForm.jmlx.split(',')
        }
        // 死亡证明表单
        this.formItem.itemInfoForm.holder = this.personinfo.name || ''
        this.formItem.itemInfoForm.holder_code = this.$route.params.cardno || ''
      } else if (item.form_path === 'subsidyFormShow') {
        // 残疾人双残补贴表单
        // this.getDisabledInfo()
        if (this.itemData.form_params) { // 编辑
          // console.log('编辑')
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
          if (!this.formItem.itemInfoForm.apply_date) {
            this.formItem.itemInfoForm.apply_date = this.getTodayDate()
          }
          if (!this.formItem.itemInfoForm.name) {
            this.formItem.itemInfoForm.name = this.personinfo.name || ''
          }
          if (!this.formItem.itemInfoForm.sex) {
            this.formItem.itemInfoForm.sex = this.personinfo.sex || ''
          }
          if (!this.formItem.itemInfoForm.phone) {
            this.formItem.itemInfoForm.phone = this.personinfo.mobile
          }
          if (!this.formItem.itemInfoForm.age) {
            this.formItem.itemInfoForm.age = this.getAge(this.$route.params.cardno)
          }
          if (!this.formItem.itemInfoForm.address) {
            this.formItem.itemInfoForm.address = this.personinfo.present_address || ''
          }
          if (!this.formItem.itemInfoForm.disabled_categories) {
            this.formItem.itemInfoForm.disabled_categories = this.$route.params.disabledPerson || this.disabledPerson
          }
          if (!this.formItem.itemInfoForm.subsidies) {
            this.formItem.itemInfoForm.subsidies = this.itemData.item_id === '11210101000000MZJD5212000207000' ? this.subsidies : '重度残疾人'
          }
          if (!this.formItem.itemInfoForm.level) {
            this.formItem.itemInfoForm.level = this.$route.params.disabledLevel || this.disabledLevel
          }
          if (!this.formItem.itemInfoForm.disable_ID_No) {
            this.formItem.itemInfoForm.disable_ID_No = this.$route.params.DISABLED_NUMBER || this.DISABLED_NUMBER
          }
          if (!this.formItem.itemInfoForm.issuing_time) {
            this.formItem.itemInfoForm.issuing_time = date2str(this.$route.params.FIRST_TIME) || date2str(this.FIRST_TIME) // 发证时间
          }
          if (!this.formItem.itemInfoForm.street) {
            this.formItem.itemInfoForm.street = this.$route.params.CJR_ALLOCATION_ID_NAME || this.CJR_ALLOCATION_ID_NAME // 社区
          }
          if (!this.formItem.itemInfoForm.guardian_phone) {
            this.formItem.itemInfoForm.guardian_phone = this.$route.params.GUARD_PHONE // 监护人电话
          }
          if (!this.formItem.itemInfoForm.guardian) {
            this.formItem.itemInfoForm.guardian = this.$route.params.GUARD_NAME // 监护人姓名
          }
          if (!this.formItem.itemInfoForm.bank_name) {
            this.formItem.itemInfoForm.bank_name = this.$route.params.bank_name
          }
          if (!this.formItem.itemInfoForm.bank_peoplename) {
            this.formItem.itemInfoForm.bank_peoplename = this.$route.params.bank_peoplename
          }
          if (!this.formItem.itemInfoForm.bank_cardno) {
            this.formItem.itemInfoForm.bank_cardno = this.$route.params.bank_cardno
          }
          if (!this.formItem.itemInfoForm.low_income_No) {
            this.formItem.itemInfoForm.low_income_No = this.$route.params.low_income_No
          }
          // this.formItem.itemInfoForm.apply_date = this.getTodayDate()
          // this.formItem.itemInfoForm.name = this.personinfo.name || ''
          // this.formItem.itemInfoForm.sex = this.personinfo.sex || ''
          // this.formItem.itemInfoForm.phone = this.personinfo.mobile
          // this.formItem.itemInfoForm.age = this.getAge(this.$route.params.cardno)
          // this.formItem.itemInfoForm.address = this.personinfo.present_address || ''
          // this.formItem.itemInfoForm.disabled_categories = this.$route.params.disabledPerson || this.disabledPerson
          // this.formItem.itemInfoForm.level = this.$route.params.disabledLevel || this.disabledLevel
          // this.formItem.itemInfoForm.disable_ID_No = this.$route.params.DISABLED_NUMBER || this.DISABLED_NUMBER
          // this.formItem.itemInfoForm.issuing_time = this.$route.params.FIRST_TIME || this.FIRST_TIME // 发证时间
          // this.formItem.itemInfoForm.street = this.$route.params.CJR_ALLOCATION_ID_NAME || this.CJR_ALLOCATION_ID_NAME // 社区
          // this.formItem.itemInfoForm.guardian_phone = this.$route.params.GUARD_PHONE // 监护人电话
          // this.formItem.itemInfoForm.guardian = this.$route.params.GUARD_NAME // 监护人姓名
          // this.formItem.itemInfoForm.bank_name = this.$route.params.bank_name
          // this.formItem.itemInfoForm.bank_peoplename = this.$route.params.bank_peoplename
          // this.formItem.itemInfoForm.bank_cardno = this.$route.params.bank_cardno
          // this.formItem.itemInfoForm.low_income_No = this.$route.params.low_income_No
          // this.personFormInfo = this.formItem.itemInfoForm
        } else {
          // console.log('创建')
          this.formItem.itemInfoForm.apply_date = this.getTodayDate()
          this.formItem.itemInfoForm.name = this.personinfo.name || ''
          this.formItem.itemInfoForm.cardno = this.$route.params.cardno || this.personinfo.cardno
          this.formItem.itemInfoForm.sex = this.personinfo.sex || ''
          this.formItem.itemInfoForm.phone = this.personinfo.mobile || ''
          this.formItem.itemInfoForm.age = this.getAge(this.$route.params.cardno)
          this.formItem.itemInfoForm.address = this.personinfo.present_address || ''
          this.formItem.itemInfoForm.disabled_categories = this.$route.params.disabledPerson || this.disabledPerson
          this.formItem.itemInfoForm.level = this.$route.params.disabledLevel || this.disabledLevel
          this.formItem.itemInfoForm.disable_ID_No = this.$route.params.DISABLED_NUMBER || this.DISABLED_NUMBER
          this.formItem.itemInfoForm.issuing_time = date2str(this.$route.params.FIRST_TIME) || date2str(this.FIRST_TIME) // 发证时间
          this.formItem.itemInfoForm.street = this.$route.params.CJR_ALLOCATION_ID_NAME || this.CJR_ALLOCATION_ID_NAME // 社区
          this.formItem.itemInfoForm.guardian_phone = this.$route.params.GUARD_PHONE // 监护人电话
          this.formItem.itemInfoForm.guardian = this.$route.params.GUARD_NAME // 监护人姓名
          this.formItem.itemInfoForm.bank_name = this.$route.params.bank_name
          this.formItem.itemInfoForm.bank_peoplename = this.$route.params.bank_peoplename
          this.formItem.itemInfoForm.bank_cardno = this.$route.params.bank_cardno
          this.formItem.itemInfoForm.low_income_No = this.$route.params.low_income_No
          this.formItem.itemInfoForm.subsidies = this.itemData.item_id === '11210101000000MZJD5212000207000' ? this.subsidies : '重度残疾人'
        }
      } else if (item.form_path === 'studentFormShow1') {
        // 入园残疾儿童，小学、初中、高中（中专）残疾学生
        if (this.itemData.form_params) { // 编辑
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        } else {
          this.getValidateRules('', this.personinfo.name, this.$route.params.cardno)
        }
      } else if (item.form_path === 'studentFormShow2') {
        // 残疾人大学生助学金
        if (this.itemData.form_params) { // 编辑
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        } else {
          this.getValidateRules('', this.personinfo.name, this.$route.params.cardno)
        }
      } else if (item.form_path === 'studentFormShow3') {
        // 低保（边）残疾人家庭大学生助学金申请
        this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
      } else if (item.form_path === 'studentFormShow4') {
        // 特殊原因造成家庭经济困难残疾人家庭大学生助学金申请
        this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
      } else if (item.form_path === 'studentFormShow5') {
        // 成人教育取得毕业证残疾人
        if (this.itemData.form_params) { // 编辑
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        } else {
          this.getValidateRules('', this.personinfo.name, this.$route.params.cardno)
        }
      } else if (item.form_path === 'assistiveevicesFormShow') {
        // 申请残疾人辅助器具
        if (this.itemData.form_params) { // 编辑
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        } else {
          this.getValidateRules2(this.personinfo.name, this.$route.params.cardno)
          this.formItem.itemInfoForm.aca051 = '01' // 适用范围
          this.formItem.itemInfoForm.aca052 = '0108' // 辅具类别
          this.formItem.itemInfoForm.aca053 = '010801' // 辅具名称

          if (this.itemData.item_id === '11210101000000CLJD5212000406002') {
            this.formItem.itemInfoForm.aca053 = '010802' // 辅具名称
          } else if (this.itemData.item_id === '11210101000000CLJD5212000406003') {
            this.formItem.itemInfoForm.aca053 = '010803' // 辅具名称
          } else if (this.itemData.item_id === '11210101000000CLJD5212000406004') {
            this.formItem.itemInfoForm.aca053 = '' // 辅具名称
          }

          if ((this.formItem.itemInfoForm.aca053 !== '' && this.formItem.itemInfoForm.aca053 !== undefined) || (this.$route.params.aca053 !== '' && this.$route.params.aca053 !== undefined)) {
            this.getValidateRules2Details()
          }
        }
      } else if (item.form_path === 'disabilityZDSHBT') {
        // 申请55-59周岁参加城乡居民养老保险的重度残疾人生活补助
        if (this.itemData.form_params) { // 编辑
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        } else {
          this.getValidateRules4(this.personinfo.name, this.$route.params.cardno)
        }
      } else if (item.form_path === 'disabilityCertificateFormShow') {
        // 申请办理《中华人民共和国残疾人证》
        if (this.itemData.form_params) { // 编辑
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        } else {
          this.formItem.itemInfoForm.aac003 = this.personinfo.name // 姓名
          this.formItem.itemInfoForm.aac002 = this.$route.params.cardno // 身份证
          this.formItem.itemInfoForm.aac004 = this.$route.params.cardno.substr(16, 1) % 2 === 1 ? '1' : '2'
          this.formItem.itemInfoForm.aac006 = this.$route.params.cardno.substr(6, 4) + '-' + this.$route.params.cardno.substr(10, 2) + '-' + this.$route.params.cardno.substr(12, 2) // 出生日期
          this.formItem.itemInfoForm.age = this.getAge(this.$route.params.cardno) // 年龄
          this.formItem.itemInfoForm.aac019 = this.personinfo.domicile_address// 户籍地址
          this.formItem.itemInfoForm.aac007 = this.personinfo.domicile_address// 籍贯
          this.formItem.itemInfoForm.aac01a = this.personinfo.address// 现住址
          this.formItem.itemInfoForm.aac01d = this.personinfo.mobile// 移动电话
        }
      } else if (item.form_path === 'disabledLevelFormShow') {
        // 申请变更《中华人民共和国残疾人证》残疾等级
        if (this.itemData.form_params) { // 编辑
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
        } else {
          this.getValidateRules5(this.personinfo.name, this.$route.params.cardno)
        }
      } else if (item.form_path === 'personInfoShow') { // 个人信息
        this.formItem.itemInfoForm.name = this.personinfo.name || ''
        this.formItem.itemInfoForm.sex = this.personinfo.sex || ''
        this.formItem.itemInfoForm.mobile = this.personinfo.mobile
        if (!this.itemData.form_params) {
          this.formItem.itemInfoForm.card_type = '1'
          this.formItem.itemInfoForm.card_no = this.personinfo.cardno
        }
      } else if (item.form_path === 'personInfoTestShow') { // 测试事项个人信息
        this.formItem.itemInfoForm.name = this.personinfo.name || ''
        this.formItem.itemInfoForm.sex = this.personinfo.sex || ''
        this.formItem.itemInfoForm.mobile = this.personinfo.mobile
        if (!this.itemData.form_params) {
          this.formItem.itemInfoForm.card_type = '1'
          this.formItem.itemInfoForm.card_no = this.personinfo.cardno
        }
      } else {
        if (!this.formItem.itemInfoForm.cardno && this.itemData.form_params) {
          this.formItem.itemInfoForm = JSON.parse(this.itemData.form_params)
          this.formItem.itemInfoForm.cardno = this.$route.params.cardno
        } else {
          this.formItem.itemInfoForm = {}
        }
        this.formItem.state++
      }
    },
    // 身份证号获取用户信息
    getuserinfo(cardno) {
      userinfo(cardno).then(res => {
        if (res.data.data) {
          this.personinfo = res.data.data
          // console.log(this.personinfo.name + '######')
          this.personinfo.type = '身份证'
          if (this.personinfo.mobile.length === 8 || this.personinfo.mobile.length === 7) {
            this.personinfo.mobile = this.personinfo.mobile.substring(0, 3) + '****' + this.personinfo.mobile.substring(6)
          } else if (this.personinfo.mobile.length === 11) {
            this.personinfo.mobile = this.personinfo.mobile.substring(0, 3) + '****' + this.personinfo.mobile.substring(7)
          } else {
            // eslint-disable-next-line no-self-assign
            this.personinfo.mobile = this.personinfo.mobile
          }
        } else {
          this.$Notice.error({ title: '查不到人员信息' })
        }
      })
    },
    saveOrder() {
      if (!this.formItem.operation) {
        this.$Notice.success({ title: '错误', desc: '非法操作' })
        return
      }
      let paramJson = {}

      let param = {
        item_id: this.$route.params.itemid,
        cardno: this.$route.params.cardno,
        auto_print_flag: '',
      }
      if (this.infflag == '212000329000') {
          param.auto_print_flag = this.Messagevalue+''
      }

      // console.log(param.autoPrintFlag,"asjdghkajshdsjkadgfhjsakals")
      // return
      let verify = true
      this.documentlist.forEach(element => {
        if (element.write_type === 'images' && element.img_urls) {
          paramJson[element.value] = element.img_urls.toString()
          if (element.document_id === 370) {
            // console.log(paramJson[element.value], '二寸照片')
            this.unemploymentItem1.acc0mg = paramJson[element.value]
          }
        } else if (element.write_type === 'form') {
          if (element.form_path === 'communityProveShow') {
            verify = this.saveJzInfo(false)
            param.form_params = this.formItem.itemInfoForm
          } else {
            param.form_params = this.formItem.itemInfoForm
            // console.log(param.form_params)
          }
        }
      })

      for (var key in param.form_params) {
        if (param.form_params[key] === '' || param.form_params[key] === undefined) {
          delete param.form_params[key]
        }
      }

      if (!verify) return
      if (JSON.stringify(param.form_params) === '{}') {
        param.form_params = null
      }
      param.params = JSON.stringify(paramJson)
      param.code = this.$route.params.code
      // 入参中 params：要件json，form_params：表单对象
      if (param.item_id === '11210101000000MZJD000000002') {
        // console.log(param)
        if (!param.form_params) {
          this.$Notice.success({ title: '错误', desc: '请填写生活自理能力' })
        }
      }
      if (param.item_id === '11210103001606506X5212000329001') {
        // console.log(param, '**********************')
        if (!param.form_params.name) {
          this.$Notice.error({ title: '请填写姓名', desc: '' })
          return false
        }
        if (!param.form_params.cardno) {
          this.$Notice.error({ title: '请填写证件号码', desc: '' })
          return false
        }
        if (!param.form_params.content) {
          this.$Notice.error({ title: '请填写参加社会实践、志愿服务内容', desc: '' })
          return false
        }
      }
      // console.log(param.form_params,"sshjkhs")
      // return
      // 123
      if (this.itemsss) {
        param.form_params = this.items
      }


      updateOrder(param).then(res => {
        this.itemsss = false
        if (res.data.data) {
          this.$Notice.success({ title: '保存成功', desc: '业务编号：' + param.code })
          this.$router.push({
            name: this.$route.params.path || 'workbench',
            params: this.$route.params.cur_data,
            refresh: true
          })
        } else {
          this.$Notice.error({ title: '保存失败', desc: res.data.errmsg })
        }
      })
    },
    // 查看图片原图功能
    originalGraph() {
      window.open(this.picPreviewMol.pic_urls[this.picPreviewMol.picIndex])
    },
    // 删除已经上传的图片
    deletePic() {
      this.picPreviewMol.pic_urls.splice(this.picPreviewMol.picIndex, 1)
      let temp = this.documentlist[this.formItem.paramIndex]
      temp.img_urls = this.picPreviewMol.pic_urls
      if (this.picPreviewMol.picIndex === 0) {
        if (temp.img_urls.length === 0) {
          temp.img_urls = null
          this.picPreviewMol.preShow = false
          this.formItem.reloadTabel = true
          temp.is_submit = '未提交'
          this.$nextTick(() => {
            this.formItem.reloadTabel = false
          })
        }
      } else {
        this.picPreviewMol.picIndex--
      }
    },
    backOrder() {
      this.$router.push({
        name: this.$route.params.path || 'workbench',
        params: this.$route.params.cur_data
      })
    },
    // 上一步（lag=false） || 下一步（flag=true）
    nextStep(flag) {
      if (flag === true) {
        this.loading = true
      } else {
        this.loading = false
      }
      this.info = {
        fileName: this.$route.params.name + this.datetime2str(new Date()),
        userid: this.personinfo.id,
        order_code: this.$route.params.code
      }
      if (!this.formItem.operation) {
        this.$Notice.success({ title: '错误', desc: '非法操作' })
        return
      }
      // 下一步按钮，当无订单编号时表示下单，否则是修改要件，operation=0时表示失败订单重新办理
      if (flag && (this.$route.params.operation === '0' || !this.$route.params.code)) {
        let param = {
          item_id: this.$route.params.itemid,
          cardno: this.$route.params.cardno,
          name: this.personinfo.name,
          mobile: this.personinfo.mobile
        }
        createOrder(param).then(res => {
          if (res.data.data) {
            this.$Notice.success({ title: '保存成功', desc: '请上传要件或表单，完善业务信息' })
            this.loading = false
            this.$route.params.code = res.data.data
            this.formItem.next_step = true
            this.info = {
              fileName: this.$route.params.name + this.datetime2str(new Date()),
              userid: this.personinfo.id,
              order_code: res.data.data
            }
          } else {
            this.$Notice.error({ title: '保存失败', desc: res.data.errmsg })
            this.loading = false
          }
        })
      } else {
        this.formItem.next_step = flag
      }
    },
    downloadPdf() { // pdf文件下载
      this.pdfModal = true
    },
    closeHeight() {
      this.gpy_shows = false
      this.openNow = false
    },
    closeHeight1() {
      this.mshow = false
      this.openNow = false
    },
    getAge(identityCard) {
      var len = (identityCard + '').length
      if (len === 0) {
        return 0
      } else {
        if ((len !== 15) && (len !== 18)) { // 身份证号码只能为15位或18位其它不合法
          return 0
        }
      }
      var strBirthday = ''
      if (len === 18) { // 处理18位的身份证号码从号码中得到生日和性别代码
        strBirthday = identityCard.substr(6, 4) + '/' + identityCard.substr(10, 2) + '/' + identityCard.substr(12, 2)
      } else if (len === 15) {
        strBirthday = '19' + identityCard.substr(6, 2) + '/' + identityCard.substr(8, 2) + '/' + identityCard.substr(10, 2)
      }
      var birthDate = new Date(strBirthday)
      var nowDateTime = new Date()
      var age = nowDateTime.getFullYear() - birthDate.getFullYear()
      if (nowDateTime.getMonth() < birthDate.getMonth() || (nowDateTime.getMonth() === birthDate.getMonth() && nowDateTime.getDate() < birthDate.getDate())) {
        age--
      }
      return age
    },
    getTodayDate() {
      var dd = new Date()
      var y = dd.getFullYear()
      var m = dd.getMonth() + 1 // 获取当前月份的日期
      var d = dd.getDate()
      var hour = dd.getHours()
      var minute = dd.getMinutes()
      var second = dd.getSeconds()
      return y + '-' + m + '-' + d + ' ' + hour + ':' + minute + ':' + second
    },
    getToday(type) {
      var dd = new Date()
      var y = dd.getFullYear()
      var m = dd.getMonth() + 1 // 获取当前月份的日期
      var d = dd.getDate()
      return type === 1 ? (y + '-' + m + '-' + d) : (y + '')
    },
    getValidateRules(type, name, cardNo) {
      let param = {
        name: name,
        cardno: cardNo,
        item_id: this.itemData.item_id,
        type: type
      }
      authentication(param).then(res => {
        if (res.data.errcode === 0) {
          this.ruleData = res.data.data.data
          if (res.data.data.code !== '1') {
            this.$Notice.error({ title: '获取人员信息失败', desc: this.ruleData.errmsg })
            return
          }

          this.formItem.itemInfoForm.aac001 = this.ruleData.aac001 // 主键
          this.formItem.itemInfoForm.aac003 = this.ruleData.aac003 || this.personinfo.name // 姓名
          this.formItem.itemInfoForm.aac002 = this.$route.params.cardno // 身份证
          this.formItem.itemInfoForm.aac004 = this.ruleData.aac004 || (this.$route.params.cardno.substr(16, 1) % 2 === 1 ? '1' : '2')
          this.formItem.itemInfoForm.aac006 = (this.$route.params.cardno.substr(6, 4) + '-' + this.$route.params.cardno.substr(10, 2) + '-' + this.$route.params.cardno.substr(12, 2)) // 出生日期
          this.formItem.itemInfoForm.age = this.getAge(this.$route.params.cardno) // 年龄
          this.formItem.itemInfoForm.aaa120 = this.ruleData.aaa120 // 所在地区
          this.formItem.itemInfoForm.aaa121 = this.ruleData.aaa121 // 所在地区码
          this.formItem.itemInfoForm.adc013 = this.ruleData.adc013 // 残疾类别
          this.formItem.itemInfoForm.adc015 = this.ruleData.adc015 // 残疾等级
          this.formItem.itemInfoForm.adc016 = this.ruleData.adc016 // 残疾证号
          this.formItem.itemInfoForm.aac019 = this.ruleData.adc019 || this.personinfo.domicile_address// 户籍地址
          this.formItem.itemInfoForm.aac01a = this.ruleData.aac01a || this.personinfo.address// 现住址
          this.formItem.itemInfoForm.aac01c = this.ruleData.aac01c // 固定电话
          this.formItem.itemInfoForm.aac01d = this.ruleData.aac01d || this.personinfo.mobile// 移动电话
          this.formItem.itemInfoForm.aac003a = this.ruleData.aac003a // 家长姓名
          this.formItem.itemInfoForm.aac002a = this.ruleData.aac002a // 家长身份证
          this.formItem.itemInfoForm.aac004a = this.ruleData.aac002a ? (this.ruleData.aac002a.substr(16, 1) % 2 === 1 ? '1' : '2') || this.ruleData.aac004a : '' // 家长性别
          this.formItem.itemInfoForm.agea = this.ruleData.aac002a ? this.getAge(this.ruleData.aac002a) || this.ruleData.agea : '' // 家长年龄
          this.formItem.itemInfoForm.aac01da = this.ruleData.aac01da // 家长电话
          this.formItem.itemInfoForm.adc016a = this.ruleData.adc016a // 家长残疾证号
          this.formItem.itemInfoForm.adc01a = this.ruleData.adc01a // 联系人姓名
          this.formItem.itemInfoForm.adc01d = this.ruleData.adc01d // 联系人固定电话
          this.formItem.itemInfoForm.adc01e = this.ruleData.adc01e // 联系人移动电话
          this.formItem.itemInfoForm.aec01b = this.getToday(2) // 申请年度格式必须为yyyy
          this.formItem.itemInfoForm.aec01c = this.getToday(1) // 申请日期格式必须为yyyy-MM-dd
          this.formItem.itemInfoForm.aac081 = this.ruleData.aac081 || this.$route.params.bank_name // 银行名称
          this.formItem.itemInfoForm.aac082 = this.ruleData.aac082 || this.$route.params.bank_peoplename // 账号
          this.formItem.itemInfoForm.aac083 = this.ruleData.aac083 || this.$route.params.bank_cardno // 账户名
          if (this.itemData.item_id === '11210101000000CLJD5212000229002') {
            this.formItem.itemInfoForm.aec111 = '3'
          }
          this.selectList.studentAidList.map(item => {
            if (item.value === this.itemData.item_id) {
              this.formItem.itemInfoForm.aec01d = item.label // 申请金额
            }
          })
          this.selectList.studentList.map(item => {
            if (item.value === this.itemData.item_id) {
              this.formItem.itemInfoForm.aec01z = item.label // 资助对象类型
            }
          })
        } else {
          this.$Notice.error({ title: '申请失败', desc: res.data.errmsg })
        }
      })
    },
    getValidateRules2(name, cNo) {
      authentication({ name: name, cardno: cNo, item_id: this.itemData.item_id }).then(res => {
        if (res.data.errcode === 0) {
          this.ruleData = res.data.data.data
          if (res.data.data.code !== '1' && res.data.data.code !== '0') {
            this.$Notice.error({ title: '获取人员信息失败', desc: this.ruleData.errmsg })
            return
          }
          let flag = this.ruleData !== ('' || undefined)
          // console.log(flag)
          this.formItem.itemInfoForm.aac001 = flag ? this.ruleData.aac001 : 0 // 主键
          this.formItem.itemInfoForm.aac003 = flag ? this.ruleData.aac003 : this.personinfo.name // 姓名
          this.formItem.itemInfoForm.aac002 = flag ? this.ruleData.aac002 : this.$route.params.cardno // 身份证
          this.formItem.itemInfoForm.aac004 = flag ? this.ruleData.aac004 : (this.$route.params.cardno.substr(16, 1) % 2 === 1 ? '1' : '2')
          this.formItem.itemInfoForm.aac005 = flag ? this.ruleData.aac005 : '' // 民族
          this.formItem.itemInfoForm.aac006 = (this.$route.params.cardno.substr(6, 4) + '-' + this.$route.params.cardno.substr(10, 2) + '-' + this.$route.params.cardno.substr(12, 2)) // 出生日期
          this.formItem.itemInfoForm.age = this.getAge(this.$route.params.cardno) // 年龄
          this.formItem.itemInfoForm.aac009 = flag ? this.ruleData.aac009 : '' // 户口性质
          this.formItem.itemInfoForm.aaa120 = flag ? this.ruleData.aaa120 : '' // 所在地区
          this.formItem.itemInfoForm.aaa121 = flag ? this.ruleData.aaa121 : '' // 所在地区码
          this.formItem.itemInfoForm.aac01d = flag ? this.ruleData.aac01d : this.personinfo.mobile // 移动电话
          this.formItem.itemInfoForm.adc013 = flag ? this.ruleData.adc013 : '' // 残疾类别
          this.formItem.itemInfoForm.adc015 = flag ? this.ruleData.adc015 : '' // 残疾等级
          this.formItem.itemInfoForm.adc016 = flag ? this.ruleData.adc016 : '' // 残疾证号
          this.formItem.itemInfoForm.adc01a = flag ? this.ruleData.adc01a : '' // 监护人姓名
          this.formItem.itemInfoForm.adc01e = flag ? this.ruleData.adc01e : '' // 监护人电话
          this.formItem.itemInfoForm.aac019 = flag ? this.ruleData.aac019 : this.personinfo.domicile_address // 户籍地址
          this.formItem.itemInfoForm.aac01a = flag ? this.ruleData.aac01a : this.personinfo.address // 现住址
          this.formItem.itemInfoForm.acc51n = this.getToday(1) // 申请日期格式必须为yyyy-MM-dd
          this.formItem.itemInfoForm.acc51m = flag ? this.ruleData.adc01a : '' // 默认监护人可修改
        } else {
          this.$Notice.error({ title: '申请失败', desc: res.data.errmsg })
        }
      })
    },
    getValidateRules2Details() {
      let param = {
        aac001: this.formItem.itemInfoForm.aac001 !== ('' || undefined) ? this.formItem.itemInfoForm.aac001 : 0,
        aac002: this.$route.params.cardno || this.personinfo.cardno,
        aac003: this.$route.params.name || this.personinfo.name,
        aca051: this.formItem.itemInfoForm.aca051 || this.$route.params.aca051,
        aca052: this.formItem.itemInfoForm.aca052 || this.$route.params.aca052,
        aca053: this.formItem.itemInfoForm.aca053 || this.$route.params.aca053,
        item_id: this.itemData.item_id
      }
      repeatApplicationValidation(param).then(res => {
        if (res.data.errcode === 0) {
          this.ruleData = res.data.data.data
          if (res.data.data.code !== '1') {
            this.$Notice.error({ title: '获取辅具信息失败', desc: res.data.data.msg })
            return
          }
          this.formItem.itemInfoForm.aca050 = this.ruleData.aca050 // 辅助器具目录流水号
          this.formItem.itemInfoForm.aca051 = this.ruleData.aca051 // 适用范围
          this.formItem.itemInfoForm.aca052 = this.ruleData.aca052 // 辅具类别
          this.formItem.itemInfoForm.aca053 = this.ruleData.aca053 // 辅具名称
          this.formItem.itemInfoForm.aca054 = this.ruleData.aca054 // 单位
          this.formItem.itemInfoForm.aca055 = this.ruleData.aca055 // 参考价格
          this.formItem.itemInfoForm.aca056 = this.ruleData.aca056 // 适用对象
          this.formItem.itemInfoForm.aca057 = this.ruleData.aca057 // 使用年限
          this.formItem.itemInfoForm.aca058 = this.ruleData.aca058 // 补贴比例
          this.formItem.itemInfoForm.aca059 = this.ruleData.aca059 // 评估级别
        } else {
          this.$Notice.error({ title: '申请失败', desc: res.data.errmsg })
        }
      })
    },
    getValidateRules3(name, cardNo) { // 低收入一级残疾人
      let param = {
        name: name,
        cardno: cardNo,
        item_id: this.itemData.item_id
      }
      authentication(param).then(res => {
        if (res.data.errcode === 0) {
          this.ruleData = res.data.data.data
          if (res.data.data.code !== 1 && res.data.data.code !== 0) {
            this.$Notice.error({ title: '获取人员信息失败', desc: res.data.data.msg })
            return
          }
          let flag = this.ruleData !== ('' || undefined)
          // console.log(flag)
          this.formItem.itemInfoForm.agc117 = flag ? '0' : '1' // 是否是残疾人
          this.formItem.itemInfoForm.aac001 = flag ? this.ruleData.aac001 : 0 // 主键
          this.formItem.itemInfoForm.aac003 = flag ? this.ruleData.aac003 : this.personinfo.name // 姓名
          this.formItem.itemInfoForm.aac002 = flag ? this.ruleData.aac002 : this.$route.params.cardno // 身份证
          this.formItem.itemInfoForm.aac004 = flag ? this.ruleData.aac004 : (this.$route.params.cardno.substr(16, 1) % 2 === 1 ? '1' : '2')
          this.formItem.itemInfoForm.aac005 = flag ? this.ruleData.aac005 : '' // 民族
          this.formItem.itemInfoForm.aac006 = (this.$route.params.cardno.substr(6, 4) + '-' + this.$route.params.cardno.substr(10, 2) + '-' + this.$route.params.cardno.substr(12, 2)) // 出生日期
          this.formItem.itemInfoForm.age = this.getAge(this.$route.params.cardno) // 年龄
          this.formItem.itemInfoForm.aac009 = flag ? this.ruleData.aac009 : '' // 户口性质
          this.formItem.itemInfoForm.aaa120 = flag ? this.ruleData.aaa120 : '' // 所在地区
          this.formItem.itemInfoForm.aaa121 = flag ? this.ruleData.aaa121 : '' // 所在地区码
          this.formItem.itemInfoForm.aac01d = flag ? this.ruleData.aac01d : this.personinfo.mobile // 移动电话
          this.formItem.itemInfoForm.adc013 = flag ? this.ruleData.adc013 : '' // 残疾类别
          this.formItem.itemInfoForm.adc015 = flag ? this.ruleData.adc015 : '' // 残疾等级
          this.formItem.itemInfoForm.adc016 = flag ? this.ruleData.adc016 : '' // 残疾证号
          this.formItem.itemInfoForm.aac019 = flag ? this.ruleData.aac019 : this.personinfo.domicile_address // 户籍地址
          this.formItem.itemInfoForm.aac01a = flag ? this.ruleData.aac01a : this.personinfo.address // 现住址
          this.formItem.itemInfoForm.aac01b = flag ? this.ruleData.aac01b : '' // 邮政编码
          this.formItem.itemInfoForm.aac01c = flag ? this.ruleData.aac01c : '' // 固定电话
          this.formItem.itemInfoForm.aac01d = flag ? this.ruleData.aac01d : this.personinfo.mobile // 移动电话
          this.formItem.itemInfoForm.adc01a = flag ? this.ruleData.adc01a : '' // 联系人姓名
          this.formItem.itemInfoForm.adc01d = flag ? this.ruleData.adc01d : '' // 联系人固定电话
          this.formItem.itemInfoForm.adc01e = flag ? this.ruleData.adc01e : '' // 联系人移动电话
          this.formItem.itemInfoForm.agc111 = this.getTodayDate() // 申请年度格式必须为yyyy-MM-dd HH:mm:ss
        } else {
          this.$Notice.error({ title: '申请失败', desc: res.data.errmsg })
        }
      })
    },
    getValidateRules4(name, cardNo) { // 申请55-59周岁参加城乡居民养老保险的重度残疾人生活补助
      let param = {
        name: name,
        cardno: cardNo,
        item_id: this.itemData.item_id
      }
      authentication(param).then(res => {
        if (res.data.errcode === 0) {
          this.ruleData = res.data.data.data
          if (res.data.data.code !== '1') {
            this.$Notice.error({ title: '获取人员信息失败', desc: res.data.data.msg })
            return
          }
          let flag = this.ruleData !== ('' || undefined)
          // console.log(flag)
          this.formItem.itemInfoForm.agc117 = flag ? '0' : '1' // 是否是残疾人
          this.formItem.itemInfoForm.aac001 = flag ? this.ruleData.aac001 : 0 // 主键
          this.formItem.itemInfoForm.aac003 = flag ? this.ruleData.aac003 : this.personinfo.name // 姓名
          this.formItem.itemInfoForm.aac002 = flag ? this.ruleData.aac002 : this.$route.params.cardno // 身份证
          this.formItem.itemInfoForm.aac004 = flag ? this.ruleData.aac004 : (this.$route.params.cardno.substr(16, 1) % 2 === 1 ? '1' : '2')
          this.formItem.itemInfoForm.aac005 = flag ? this.ruleData.aac005 : '' // 民族
          this.formItem.itemInfoForm.aac006 = (this.$route.params.cardno.substr(6, 4) + '-' + this.$route.params.cardno.substr(10, 2) + '-' + this.$route.params.cardno.substr(12, 2)) // 出生日期
          this.formItem.itemInfoForm.age = this.getAge(this.$route.params.cardno) // 年龄
          this.formItem.itemInfoForm.aac009 = flag ? this.ruleData.aac009 : '' // 户口性质
          this.formItem.itemInfoForm.aaa120 = flag ? this.ruleData.aaa120 : '' // 所在地区
          this.formItem.itemInfoForm.aaa121 = flag ? this.ruleData.aaa121 : '' // 所在地区码
          this.formItem.itemInfoForm.aac01d = flag ? this.ruleData.aac01d : this.personinfo.mobile // 移动电话
          this.formItem.itemInfoForm.adc013 = flag ? this.ruleData.adc013 : '' // 残疾类别
          this.formItem.itemInfoForm.adc015 = flag ? this.ruleData.adc015 : '' // 残疾等级
          this.formItem.itemInfoForm.adc016 = flag ? this.ruleData.adc016 : '' // 残疾证号
          this.formItem.itemInfoForm.aac019 = flag ? this.ruleData.aac019 : this.personinfo.domicile_address // 户籍地址
          this.formItem.itemInfoForm.aac01a = flag ? this.ruleData.aac01a : this.personinfo.address // 现住址
          this.formItem.itemInfoForm.aac01b = flag ? this.ruleData.aac01b : '' // 邮政编码
          this.formItem.itemInfoForm.aac01c = flag ? this.ruleData.aac01c : '' // 固定电话
          this.formItem.itemInfoForm.aac01d = flag ? this.ruleData.aac01d : this.personinfo.mobile // 移动电话
          this.formItem.itemInfoForm.adc01a = flag ? this.ruleData.adc01a : '' // 联系人姓名
          this.formItem.itemInfoForm.adc01d = flag ? this.ruleData.adc01d : '' // 联系人固定电话
          this.formItem.itemInfoForm.adc01e = flag ? this.ruleData.adc01e : '' // 联系人移动电话
          this.formItem.itemInfoForm.ajc111 = this.getTodayDate()
          this.formItem.itemInfoForm.ajc114 = this.getToday(2) // 申请年度格式必须为yyyy
          var currQuarter = new Date().getMonth() + 1
          this.formItem.itemInfoForm.ajc115 = Math.floor((currQuarter % 3 === 0 ? (currQuarter / 3) : (currQuarter / 3 + 1)))
        } else {
          this.$Notice.error({ title: '申请失败', desc: res.data.errmsg })
        }
      })
    },
    getValidateRules5(name, cardNo) { // 申请变更《中华人民共和国残疾人证》残疾等级
      let param = {
        name: name,
        cardno: cardNo,
        item_id: this.itemData.item_id
      }
      checkDisabilityCertificateAll(param).then(res => {
        if (res.data.errcode === 0) {
          this.ruleData = res.data.data.data
          if (res.data.data.code !== '1') {
            this.$Notice.error({ title: '获取人员信息失败', desc: res.data.data.msg })
            return
          }
          let flag = this.ruleData !== ('' || undefined)
          this.formItem.itemInfoForm.aac001 = flag ? this.ruleData.aac001 : 0 // 主键
          this.formItem.itemInfoForm.aac003 = flag ? this.ruleData.aac003 : this.personinfo.name // 姓名
          this.formItem.itemInfoForm.aac002 = flag ? this.ruleData.aac002 : this.$route.params.cardno // 身份证
          this.formItem.itemInfoForm.aac004 = flag ? this.ruleData.aac004 : (this.$route.params.cardno.substr(16, 1) % 2 === 1 ? '1' : '2')
          this.formItem.itemInfoForm.aac005 = flag ? this.ruleData.aac005 : '' // 民族
          this.formItem.itemInfoForm.aac006 = (this.$route.params.cardno.substr(6, 4) + '-' + this.$route.params.cardno.substr(10, 2) + '-' + this.$route.params.cardno.substr(12, 2)) // 出生日期
          this.formItem.itemInfoForm.age = this.getAge(this.$route.params.cardno) // 年龄
          this.formItem.itemInfoForm.aac007 = flag ? this.ruleData.aac007 : '' // 籍贯
          this.formItem.itemInfoForm.aac009 = flag ? this.ruleData.aac009 : '' // 户口性质
          this.formItem.itemInfoForm.aaa120 = flag ? this.ruleData.aaa120 : '' // 所在地区
          this.formItem.itemInfoForm.aaa121 = flag ? this.ruleData.aaa121 : '' // 所在地区码
          this.formItem.itemInfoForm.aac01d = flag ? this.ruleData.aac01d : this.personinfo.mobile // 移动电话
          this.formItem.itemInfoForm.adc013 = flag ? this.ruleData.adc013 : '' // 残疾类别
          this.formItem.itemInfoForm.adc015 = flag ? this.ruleData.adc015 : '' // 残疾等级
          this.formItem.itemInfoForm.adc016 = flag ? this.ruleData.adc016 : '' // 残疾证号
          this.formItem.itemInfoForm.aac019 = flag ? this.ruleData.aac019 : this.personinfo.domicile_address // 户籍地址
          this.formItem.itemInfoForm.aac01a = flag ? this.ruleData.aac01a : this.personinfo.address // 现住址
          this.formItem.itemInfoForm.aac01b = flag ? this.ruleData.aac01b : '' // 邮政编码
          this.formItem.itemInfoForm.aac01c = flag ? this.ruleData.aac01c : '' // 固定电话
          this.formItem.itemInfoForm.aac01d = flag ? this.ruleData.aac01d : this.personinfo.mobile // 移动电话
        } else {
          this.$Notice.error({ title: '申请失败', desc: res.data.errmsg })
        }
      })
    },
    // 社区统计下拉搜索框的级联查询
    bb() {
      this.sectionListb = []
      let param = { id: this.formDate.qxId }
      getMailLevelList(param).then(res => {
        if (res.data.errcode === 0) {
          this.sectionListb = res.data.data
          // console.log(this.sectionListb)
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    cc() {
      this.sectionListc = []
      let param = { id: this.formDate.jdId }
      getMailLevelList(param).then(res => {
        if (res.data.errcode === 0) {
          this.sectionListc = res.data.data
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    getPermanentAddress() {
      this.sectionList = []
      getMailLevelList().then(res => {
        if (res.data.errcode === 0) {
          this.sectionList = res.data.data
          // console.log(this.sectionList)
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    getValidateRulesCode() {
      let q = { company_code: this.formDate.company_code }
      getSQCodeFc(q).then(res => {
        if (res.data.errcode === 0) {
          this.formItem.itemInfoForm.aaa121 = res.data.data.qu + res.data.data.jiedao + res.data.data.shequ // 所在地区
          this.formItem.itemInfoForm.aaa120 = res.data.data.shequ_code // 所在地区码
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    getDisabledInfo() { // 查询残疾殡葬前置信息
      var param1 = {
        'method': 'getQSTBCardInfo',
        'disabled_data': {
          'item_id': this.$route.params.itemid,
          'cardno': this.$route.params.cardno
        },
        'accountid': 'qstb'
      }
      createDisabilityApi(param1).then(ret => {
        if (ret.data.errcode === 0) {
          // if (!ret.data.data.data.getFuneralInfoMap.hhsj) {
          //   this.funeralPersonnelFlag = 'false'
          // } else {
          //   this.funeralPersonnelFlag = 'true'
          // }

          if (ret.data.data.data.findCanlianMap.length !== 0) {
            this.disabledLevel = ret.data.data.data.findCanlianMap[0].DISABLED_LEVEL
            // console.log(this.disabledLevel, '残疾等级')
            this.disabledPerson = ret.data.data.data.findCanlianMap[0].DISABLED_TYPE_NAME
            this.DISABLED_NUMBER = ret.data.data.data.findCanlianMap[0].DISABLED_NUMBER
            this.CJR_ALLOCATION_ID_NAME = ret.data.data.data.findCanlianMap[0].CJR_ALLOCATION_ID_NAME
            this.FIRST_TIME = ret.data.data.data.findCanlianMap[0].FIRST_TIME
          } else {
            this.disabledLevel = ''
            this.disabledPerson = '非残疾人 '
          }
          return
        }
        this.$Modal.error({
          title: '获取残疾人残疾信息失败',
          content: ret.data.errmsg,
          onOk: () => {
          }
        })
      })
    },
    formatLowSubsidies(val) {
      return val === '1010' ? '低保残疾人' : val === '1020' ? '低收入家庭残疾人' : val === '1030' ? '低保残疾人' : val === '1040' ? '低收入家庭残疾人' : val === '9999' ? '非保障对象' : val === '1050' ? '低保残疾人' : val === '1060' ? '低保残疾人' : val === '1070' ? '低保残疾人' : val === '1080' ? '低保残疾人' : val === '1090' ? '低保残疾人' : val === '0000' ? '低保停救对象' : ''
    },
    getIdCard() {
      this.interval = setInterval(this.getDeviceCardInfo, 2000)
    },
    goonTodo() {
      this.cardDeviceFlag = false
      clearInterval(this.interval)
    },
    getDeviceCardInfo() {
      // console.log('ddd')
      this.$refs.wlEquipment1.readIdCard()
    }
  },
  mounted() {
    let currentUrl = window.location.href
    if ((currentUrl.indexOf('localhost') !== -1) || (currentUrl.indexOf('http://iview') !== -1)) {
      // this.getIdCard()
    }
    // this.getIdCard()
    this.disabledAuxiliaryInfo = this.$route.params
    this.severUserInfo = this.$store.state.user.severUserInfo
    this.formItem.operation = this.$route.params.operation === '1'
    this.formItem.next_step = false
    this.buttonState = this.$route.params.state
    // console.log(this.formItem.next_step, this.formItem.operation, this.$route.params.operation, '~~~~~')
    // console.log(this.$route.params.state, '~~~~~1111')
    let param = {
      'cardno': this.$route.params.cardno,
      'id': this.$route.params.itemid,
      'code': this.$route.params.code,
      'params': '1'
    }

    this.subsidies = this.$route.params.subsidies

    if (this.subsidies === '' || this.subsidies === undefined) {
      createDisabilityApi({
        method: 'getAllowancesInfo',
        disabled_data: {
          'item_id': this.$route.params.itemid,
          'cardno': this.$route.params.cardno,
          'Name': this.personinfo.name
        },
        accountid: 'qstb'
      }).then(ret => {
        if (ret.data.errcode === 0) {
          this.subsidies = this.formatLowSubsidies(ret.data.data.data.data.type)
        }
      })
    }
    this.cardno = param.cardno
    this.getuserinfo(param.cardno)
    this.getPermanentAddress()
    iteminf(param).then(res => {
      // alert("111")
      if (res.data.data) {
        this.form_url = res.data.data.form_url
        this.itemData = res.data.data
        this.infflag = res.data.data['CATALOG_CODE']
        if(this.infflag=='212000329000'){
          this.Messagevalue = res.data.data.auto_print_flag+''
        }
        
        this.documentlist = res.data.data.documentlist
        this.documentlist.forEach(element => {
          element.necessary_name = element.necessary === '1' ? '必填' : '非必填'
          element.is_submit = '未提交'
          if (element.write_type === 'images') {
            element.type_name = '图片要件'
            if (element.img_url) {
              element.img_urls = element.img_url.split(',')
              element.is_submit = '已提交'
            }
          } else if (element.write_type === 'form') {
            element.type_name = '表单'
            if (element.write_type === 'form' && element.formdata) {
              this.formItem.itemInfoForm = element.formdata
              element.is_submit = '已提交'
            } else if (this.itemData.form_params) {
              element.is_submit = '已提交'
            }
          }
        })
      }
    })
    this.getDisabledInfo()
    this.nophoto = this.personinfo.nophoto // 申请人头像
    if (this.$route.params.operation === '1' && this.$route.params.code) {
      // console.log('000-----------------')
      this.nextStep(true)
    }
  }
}
</script>
